Random ID`s picker
#1

How to make simple loto system whit random ID`s, example: to evry 30min pick one ID and give him money....I know how to make timer and evrything but i dont know how to make random ID`s example 2,5,8,15,7,3.... and if is that ID not online then its get message: Nobody was won lotery today.....
Reply
#2

bump
Reply
#3

https://sampwiki.blast.hk/wiki/Random
Reply
#4

Quote:
Originally Posted by Don Correlli
that is for random spawn, i need for random ID
Reply
#5

That's a random function, you can use it for any random thing you need, not only spawns.
Reply
#6

Quote:
Originally Posted by Don Correlli
That's a random function, you can use it for any random thing you need, not only spawns.
hmm i will try.... tny correlli
Reply
#7

Try this:
pawn Код:
stock GetRandomPlayer(){
  new pls[500], pl;
  for(new i=0; i<500; i++){
    if(IsPlayerConnected(i)){
      pls[pl] = i;
      pl++;
    }
  }
  return pls[random(pl)];
}

// Usage:
new pid = GetRandomPlayer();
GivePlayerMoney(pid,50000);
SendClientMessage(pid,COLOR,"You won!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)