Random player
#1

Hello,

How could i get a random player id, please i do not want any stock

thanks
Reply
#2

It's easy

Код:
#include <a_samp>
#include <foreach>

foreach(new i: Player)// Efficient loop to get all players
{
   new random(i) // you are now selecting a random person
   // and now it's upon you what u want to do with guy.

}
Reply
#3

random(MAX_PLAYERS);?
Reply
#4

thank you
Reply
#5

If you use foreach (and you should) use
pawn Код:
Iter_Random(Player)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)