How do I?
#1

How do I make my script auto. move on to another minigame after five minutes? I know the commands to make it go to another minigame but is there a way to make the script know when five minutes is up to just go to the next?

Example:
Код:
I got three minigames so far. One called Hay Climb, gungame & Mini Wars IV. I want a timer to go off after five minutes when its on the minigame Mini Wars to just go straight to a new one.
I just need the code to make it switch after a 5 minute period. Hopefully this makes since I cannot really explain it that well, but hopefully someone gets what I mean.
Reply
#2

For a basic idea. You need to create a global variable will specify the current game.
pawn Код:
forward SwitchGame();
new CurrentGame = 1;
#define MAX_GAMES 3 // The ammount of your games
/* You will also need to identify / define your games, EX:
1 = hay climb
2 = gun game
3 = miniwars_IV
or use #define miniwars_IV 1
pawn Код:
public OnGameModeInit()
{
    SetTimer("SwitchGame",60*1000*5,true);
}
pawn Код:
public SwitchGame()
{
   if (CurrentGame == MAX_GAMES) CurrentGame = 1;
   CurrentGame++;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
   switch (CurrentGame)
   {
        case 1:
        {
            // Set positions, etc, according to game 1.
        }
        case 2:
        {
            // Set positions, etc, according to game 2.
        }
        case 3:
        {
            // Set positions, etc, according to game 3.
        }
         return 1;
}
I hope you get the basic idea, and If you can't manage to script it yourself basing off this, you should not make it, it will give you a headache.
Ye sorry for identation
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)