Making a random SendClientMessage
#1

Hi
I've currently got this code:

{
gPlayerLogged[playerid] = 1;
printf("%s has entered his password",PlayerInfo[playerid][pName]);
SendClientMessage(playerid, COLOR_WHITE,"Your login details are being checked by our secure server - Please wait...");
// new timer for login -> spawn
SetTimerEx("SpawnPlayerEx",5000,0,"i",playerid);

}

How could I get so that the next line is random - maybe from a selection of 5.

I presume I'd use random - but I would appreciate it if someone could demonstrate how. Is it 'new random'?

Matt
Reply
#2

pawn Код:
new rand = random(5);

switch(rand)
{
  case 0:{do something}
  case 1:{do something}
  case 2:{do something}
  case 3:{do something}
  case 4:{do something}
}
Reply
#3

https://sampwiki.blast.hk/wiki/Random_Messages
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)