Random Gamemode
#1

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.
Reply
#2

bump
Reply
#3

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.
Reply
#4

Код:
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"
Reply
#5

You forgot to add the forward, and you cannot place ChangeMode inside a callback... Only the timer has to be under OnGameModeInit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)