Quote:
Originally Posted by lazarev
PHP Code:
WinnerCheck()
{
new players[32], num, id;
get_players( players, num );
for( new i = 0; i < num; i++ )
{
id = players[ i ];
if(Kills[id] >= RequiredKills)
{
new szName[ 33 ];
get_user_name( id, szName, 32 );
client_print(0,print_chat "%s have won this event!", szName );
return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE;
}
call WinnerCheck() at round end or at deathmsg.
|
It's stupid, but you're missing a comma after print_chat. Also, he wants it for both teams so..
PHP Code:
WinnerCheck()
{
new players[32], num, id;
get_players( players, num );
for( new i = 0; i < num; i++ )
{
id = players[ i ];
if( (cs_get_user_team(id) == CS_TEAM_T) && (Kills[id] >= RequiredKills) )
{
new szName[ 33 ];
get_user_name( id, szName, 32 );
client_print(0, print_chat, "%s has the most kills on the terrorist team!", szName );
return PLUGIN_CONTINUE;
}
if( (cs_get_user_team(id) == CS_TEAM_CT) && (Kills[id] >= RequiredKills) )
{
new szName[ 33 ];
get_user_name( id, szName, 32 );
client_print(0, print_chat, "%s has the most kills on the counter-terrorist team!", szName );
return PLUGIN_CONTINUE;
}
}
return PLUGIN_CONTINUE;
}
Of course with the cs_get_user_team he'll have to use #include <cstrike> but it couldn't hurt anyone.
__________________