04.01.2012, 13:29
hi there, I need ur help:
Im trying to get random other player id, if he is connected, not npc and not himself
after that i check id and its, for example, 263 even player limit is 100
I've tried with while loop, but then server stops(get crashed).
SO, any help?
Im trying to get random other player id, if he is connected, not npc and not himself
pawn Код:
for(new j = 0;j < MAX_PLAYERS; j++)
{
i = random(MAX_PLAYERS);
if(IsPlayerConnected(i) && i!=playerid && !IsPlayerNPC(i)) break;
}
I've tried with while loop, but then server stops(get crashed).
SO, any help?