pick a random guy?
#6

without using foreach you could do this

pawn Код:
stock GetRandomPlayerID()
{
    new op;
    new po[MAX_PLAYERS];
    for(new playerid;playerid<MAX_PLAYERS;playerid++)
    {
        if(!IsPlayerConnected(playerid))continue;
        po[op]=playerid; // HAHAHHA POOP!
        op++;
    }
    return po[random(op)];
}
Reply


Messages In This Thread
pick a random guy? - by MrIncredible - 11.01.2011, 22:48
Re: pick a random guy? - by Kitten - 11.01.2011, 23:00
Re: pick a random guy? - by MrIncredible - 11.01.2011, 23:04
AW: pick a random guy? - by Extremo - 11.01.2011, 23:07
Re: pick a random guy? - by Kyosaur - 11.01.2011, 23:14
Re: pick a random guy? - by Joe Staff - 11.01.2011, 23:22

Forum Jump:


Users browsing this thread: 1 Guest(s)