random ID
#1

hi there, I need ur 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;
}
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?
Reply


Messages In This Thread
random ID - by marrcko - 04.01.2012, 13:29
Re: random ID - by [ABK]Antonio - 04.01.2012, 13:49
Re: random ID - by Babul - 04.01.2012, 13:51
Re: random ID - by Joe_ - 04.01.2012, 13:53
Re: random ID - by marrcko - 04.01.2012, 14:07
Re: random ID - by [MG]Dimi - 04.01.2012, 14:13
Re: random ID - by Babul - 04.01.2012, 14:43
Re: random ID - by RyDeR` - 04.01.2012, 14:47

Forum Jump:


Users browsing this thread: 1 Guest(s)