RandomPlayeriID
#1

Hello all !
how to make, to the server every 5 minutes random worked on player.
For example, to every 5 minutes, Random Player is given a pistol?

p sorry, i could find code in search, but i bad know English Language.
Help me please
Reply
#2

This might work, I'm not sure though, cannot guarantee you anything.
Edit the "random(201)" to your playerslots+1, examply your server has 51 slots, then set it to random(51);

pawn Код:
forward RandomPlayer();
public RandomPlayer()
{
    new randomplayer = random(201);
    if(!IsPlayerConnected(randomplayer)) return RandomPlayer();
    else
    {
      GivePlayerWeapon(randomplayer, 38, 5000);
      return 1;
    }
}
Reply
#3

are else options?
Reply
#4

Quote:
Originally Posted by //exora
This might work, I'm not sure though, cannot guarantee you anything.
Edit the "random(201)" to your playerslots+1, examply your server has 51 slots, then set it to random(51);

pawn Код:
forward RandomPlayer();
public RandomPlayer()
{
    new randomplayer = random(201);
    if(!IsPlayerConnected(randomplayer)) return RandomPlayer();
    else
    {
      GivePlayerWeapon(randomplayer, 38, 5000);
      return 1;
    }
}
Do not working... ;((
Help me please
Reply
#5

Add
pawn Код:
SetTimer("RandomPlayer", 300000, true);
under OnGameModeInit
Reply
#6

Quote:
Originally Posted by dice7
Add
pawn Код:
SetTimer("RandomPlayer", 300000, true);
under OnGameModeInit
I know that need to start public, I did a timer and not only, not work(
Reply
#7

up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)