SA-MP Forums Archive
Making a random SendClientMessage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Making a random SendClientMessage (/showthread.php?tid=106203)



Making a random SendClientMessage - Mattjones17 - 01.11.2009

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


Re: Making a random SendClientMessage - dice7 - 01.11.2009

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}
}



Re: Making a random SendClientMessage - Peter_Corneile - 01.11.2009

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