Random Gamemode - 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: Random Gamemode (
/showthread.php?tid=263439)
Random Gamemode -
muhib777 - 21.06.2011
How can i make a script where when the timer reaches 10 minutes the gamemode will change into a random one that i have listed.
Re: Random Gamemode -
muhib777 - 22.06.2011
bump
Re: Random Gamemode -
Zh3r0 - 22.06.2011
Use a timer and something like this:
pawn Код:
forward ChangeMode();
public ChangeMode()
{
switch(random(3))
{
case 0: SendRconCommand("changemode GM1");
case 1: SendRconCommand("changemode GM2");
case 2: SendRconCommand("changemode GM3");\
}
}
//When scripts tarts
SetTimer("ChangeMode", 10 * (60 * 60), 0); //Change 10 with your minutes.
Re: Random Gamemode -
muhib777 - 22.06.2011
Код:
59 public OnGameModeInit()
60 {
61
62 public ChangeMode()
63 {
64 switch(random(2))
65 {
66 case 0: SendRconCommand("ChangeMode Ship War");
67 case 1: SendRconCommand("ChangeMode Aircrafts");
68 }
69 }
70
71 //When scripts tarts
72 SetTimer("ChangeMode", 10 * (60 * 60), 0); //Change 10 with your minutes.
(62) : error 029: invalid expression, assumed zero
(62) : error 017: undefined symbol "ChangeMode"
Re: Random Gamemode -
alpha500delta - 22.06.2011
You forgot to add the forward, and you cannot place ChangeMode inside a callback... Only the timer has to be under OnGameModeInit.