26.03.2010, 12:03
Try this:
pawn Код:
stock GetRandomPlayer(){
new pls[500], pl;
for(new i=0; i<500; i++){
if(IsPlayerConnected(i)){
pls[pl] = i;
pl++;
}
}
return pls[random(pl)];
}
// Usage:
new pid = GetRandomPlayer();
GivePlayerMoney(pid,50000);
SendClientMessage(pid,COLOR,"You won!");