Pierwsza runda, plugin wyświetla, że restart za 20 rund. TT podkłada pake ct / tt wygrywa. Druga rund, plugin nadal pokazuję, że 20 rund do końca.
Więc coś nie nalicza podłożenia paki ;x Ogólnie działa tylko nie liczy rundy jak paka była podłożona.
#include <amxmodx> #include <colorchat> #define LIMIT 20 new tt, ct; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_logevent("logevent_RoundEnd", 2, "1=Round_End"); register_message(get_user_msgid("TextMsg"), "message_TextMsg"); register_logevent("logevent_RoundStart", 2, "1=Round_Start"); } public message_TextMsg( const MsgId, const MsgDest, const MsgEntity ) { static message[32]; get_msg_arg_string(2, message, charsmax(message)); if(equal(message, "#Game_will_restart_in")) ct = tt = 0; else if(equal(message, "#Terrorists_Win")) tt++; else if(equal(message, "#CTs_Win")) ct++; } public logevent_RoundEnd() { if(tt+ct >= LIMIT) { set_cvar_num("sv_restart", 1) if(tt > ct) ColorChat(0, TEAM_COLOR, "[DD2] Wygrali Terrorysci %d/%d", tt, ct); else ColorChat(0, TEAM_COLOR, "[DD2] Wygrali Anty Terrorysci %d/%d", ct, tt); ct = tt = 0; } } public logevent_RoundStart() ColorChat(0, GREEN, "[DD2] Restart mapy za %d rund", LIMIT - (ct+tt));