I'm trying to make a plugin which makes the CS exit after one team reach the win limit, but it didn't work.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#define PLUGIN "Round End"
#define VERSION "1.0"
#define AUTHOR "DavidJr"
new g_iTScore, g_iCTScore
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TeamScore", "Event_TeamScore", "a")
}
public Event_TeamScore(id)
{
new szTeam[2]
read_data(1, szTeam, charsmax(szTeam))
switch( szTeam[0] )
{
case 1:
{
g_iCTScore = read_data(2)
}
case 2:
{
g_iTScore = read_data(2)
CheckScore(id)
}
}
}
CheckScore(id)
{
new winlimit = get_cvar_num("mp_winlimit")
if( g_iTScore || g_iCTScore == winlimit )
{
console_cmd(id, "exit")
}
}