03.05.2009, 18:32
How can i choose a random player?
I think of
or sth. like this...
Hope on your answer,
Trooper
I think of
Код:
random(MAX_PLAYERS)
Hope on your answer,
Trooper
random(MAX_PLAYERS)
for(new i=0;i<MAX_PLAYERS;i++)
{
//stuff here
}
Originally Posted by Trooper[Y
]
This is what i already know... I mean, even if im making a loop for every player, how can i pick ONE Player ?! |
new RandPlayer = random(i);
break;
stock GetRandomID()
{
new randn = random(MAX_PLAYERS);
if(IsPlayerConnected(randn)) return randn;
else
{
return GetRandomID();
}
}
public RandPlayer1()
{
GivePlayerWeapon(GetRandomID(), 16, 5);
SetPlayerArmour(GetRandomID(), 100);
SendClientMessageToAll(COLOR_YELLOW, "[Random: A Random Player has been given ''5 Grenades'' and ''Full Armor'']");
return 1;
}