30.08.2010, 17:12
i have updated the code:
It's not spectating the enemy, but just looking at the water + bridge...
It's not spectating the enemy, but just looking at the water + bridge...
pawn Code:
stock GetRandomTeamPlayerForPlayer(playerid)
{
new rand = -1;
new Float:health;
if(ThisMode == 1)
{
while(rand == -1)
{
rand = random(MAX_PLAYERS);
if(mTeam[rand] != mTeam[playerid] || !IsPlayerConnected(rand)) rand = -1;
GetPlayerHealth(rand, health);
if(health <= 0) rand = -1;
}
return rand;
}
else if(ThisMode == 2)
{
while(rand == -1)
{
rand = random(MAX_PLAYERS);
if(!IsPlayerConnected(rand)) rand = -1;
GetPlayerHealth(rand, health);
if(health <= 0) rand = -1;
}
}
return rand;
}