SA-MP Forums Archive
how make random run function - 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: how make random run function (/showthread.php?tid=106388)



how make random run function - user226 - 02.11.2009

how make random run function?
I haveEXAMPLE)

Код:
forward mes();
public mes()
{
SendClientMessageToAll(color,"mes func");
}

forward sem();
public sem()
{
SendClientMessageToAll(color,"sem function");
}

forward goga();
public goga()
{
SendClientMessageToAll(color,"goga func");
}
how make To run these functions randomly from commands?
if not understand tell me, i edit message Please Help me..


Re: how make random run function - yom - 02.11.2009

Do they really need to be public functions?

pawn Код:
switch (random(3))
{
  case 0 : mes();
  case 1 : sem();
  case 2 : goga();
}
If you want to call those functions from another script, use CallRemoteFunction.


Re: how make random run function - user226 - 02.11.2009

thanks


Re: how make random run function - Pho3niXx - 02.11.2009

Quote:
Originally Posted by 0rb
Do they really need to be public functions?

pawn Код:
switch (random(3))
{
  case 0 : mes();
  case 1 : sem();
  case 2 : goga();
}
If you want to call those functions from another script, use CallRemoteFunction.
that is right guillaume