I am using this right now:
PHP Code:
public Ham_PlayerKilled( iVictim, iAttacker, shouldgib )
{
new iPlayers[ 32 ], iCount;
get_players( iPlayers, iCount, "aech", "TERRORIST" )
if( iCount == 1 ) StopGame();
}
I am calling it like this:
PHP Code:
public SniperGame()
{
g_iCurrentGame = GAME_Sniper
new iPlayers[32]
new iNum
new id
set_cvar_num("mp_friendlyfire",1)
get_players( iPlayers, iNum, "a" )
for( new i = 0; i < iNum; i++ )
{
id = iPlayers[i]
set_hudmessage ( 69, 230, 0, -1.0, 0.35, 0, 0.1, 5.0, 0.1, 0.1, -1 )
show_hudmessage ( 0, "[RPGSD]: Sniper Game Started!")
strip_user_weapons( id )
if (cs_get_user_team(id) == CS_TEAM_CT)
{
give_item(id, "weapon_knife")
give_item(id, "weapon_m4a1")
give_item(id, "weapon_deagle")
cs_set_user_bpammo( id, CSW_M4A1, 90 )
cs_set_user_bpammo( id, CSW_DEAGLE, 35 )
set_user_godmode(id, 1)
fm_reset_user_model(id)
But the problem is that when there is 2 lefts, StopGame command runs it automatic.
Because it thinks 1 of the T is CT. He gets CT skin and so on.
Am i doing it wrong?
I got this code from my friend.
But I don't know how to use it can someone help me?
PHP Code:
stock getPlayers(CsTeams:iTeam)
{
new players
for(new i = 1; i < 33; i++)
if(is_user_connected(i) && !is_user_bot(i) && is_user_alive(i))
if(cs_get_user_team(i) == iTeam) players++
return players
}
PHP Code:
if(getPlayers(CS_TEAM_T) == 1)