04.05.2011, 13:02
Hello, how do I make that code picks a player randomly from TEAM_ONE and gives him extra goods, like armour, skin or something like that?
new PlayerList[MAX_PLAYERS];
new idx;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerTeam(i) == TEAM_ONE)
{
PlayerList[idx] = i;
idx++;
}
}
}
new randomplayer = PlayerList[random(idx)];
GivePlayerMoney(randomplayer, 10000);
SetPlayerArmour(randomplayer, 100);