Getting a random ID
#5

If you want to be sure, that really somebody is kicked at this time, but you still want it to be randomly, you may try this:
pawn Код:
new playa=random(MAX_PLAYERS);
if(IsPlayerConnected(playa)==0)
{
while(IsPlayerConnected(playa)==0)
{
playa=random(MAX_PLAYERS);
}
}

if(IsPlayerConnected(playa)) Kick(playa);
I used a "If" before, because it makes me better to notice what's going on. I think you actually could just delete it.
This might not be the best sollution, but i guess it does, what you want it to do.

Pls correct me if i'm wrong. Thanks.

Cheers,
DeathOnaStick
Reply


Messages In This Thread
Getting a random ID - by Striker_Moe - 05.11.2009, 14:55
Re: Getting a random ID - by Kurence - 05.11.2009, 14:56
Re: Getting a random ID - by Harry_Gaill - 05.11.2009, 15:50
Re: Getting a random ID - by Correlli - 05.11.2009, 15:51
Re: Getting a random ID - by DeathOnaStick - 05.11.2009, 16:27
Re: Getting a random ID - by Harry_Gaill - 12.11.2009, 15:13

Forum Jump:


Users browsing this thread: 1 Guest(s)