-
Автор темы
- #1
logs.cpp =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
if (g_cfg.misc.events_to_log [EVENTLOG_VOTE] &&! strcmp (event-> GetName (), crypt_str ("vote_cast")))
{
auto userid = event-> GetInt (crypt_str ("entityid"));
player_info_t userid_info;
if (! m_engine () -> GetPlayerInfo (userid, & userid_info))
return;
std :: stringstream ss;
ss << userid_info.szName << crypt_str ("Voted:") << (event-> GetInt (crypt_str ("vote_option")) == 0? crypt_str ("YES"): crypt_str ("NO"));
add (ss.str ());
}
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
Hooked_events.cpp =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
eventmanager-> AddListener (this, crypt_str ("vote_cast"), false);
g_ctx.globals.events.emplace_back (crypt_str ("vote_cast"));
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
configs.h =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
enum
{
EVENTLOG_HIT,
EVENTLOG_ITEM_PURCHASES,
EVENTLOG_BOMB,
EVENTLOG_VOTE // add this one
};
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
constchars.h =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
const char * events [] =
{
"Player hits",
"Items",
"Bomb",
"VOTE" // add this one
};
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
// i will ignore all the hate so .... dont waste your time =]
edit : all the credits goes to the creator of this code (
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
if (g_cfg.misc.events_to_log [EVENTLOG_VOTE] &&! strcmp (event-> GetName (), crypt_str ("vote_cast")))
{
auto userid = event-> GetInt (crypt_str ("entityid"));
player_info_t userid_info;
if (! m_engine () -> GetPlayerInfo (userid, & userid_info))
return;
std :: stringstream ss;
ss << userid_info.szName << crypt_str ("Voted:") << (event-> GetInt (crypt_str ("vote_option")) == 0? crypt_str ("YES"): crypt_str ("NO"));
add (ss.str ());
}
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
Hooked_events.cpp =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
eventmanager-> AddListener (this, crypt_str ("vote_cast"), false);
g_ctx.globals.events.emplace_back (crypt_str ("vote_cast"));
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
configs.h =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
enum
{
EVENTLOG_HIT,
EVENTLOG_ITEM_PURCHASES,
EVENTLOG_BOMB,
EVENTLOG_VOTE // add this one
};
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
constchars.h =
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
const char * events [] =
{
"Player hits",
"Items",
"Bomb",
"VOTE" // add this one
};
-------------------------------------------------- -------------------------------------------------- --------------------------------------------
// i will ignore all the hate so .... dont waste your time =]
edit : all the credits goes to the creator of this code (
Пожалуйста, авторизуйтесь для просмотра ссылки.
)Вложения
-
381.2 KB Просмотры: 260
Последнее редактирование: