[Tutorial] [Beginner's Tutorial] Gamemode Changing System
#1

Gamemode Changing System
Simple, Usefull and Easy.
_____________________________________
A system in which gamemode changes in a given time. This system is very usefull for DeathMatch Servers and for
Mini-Game Servers.


A Very Short Tutorial.

_________________________

↓ Let's Start ↓


Making a variable to set the timer of changing gamemode.

pawn Code:
new GamemodeTimer = 120000; // 1 sec = 1000 and 2 mins (2 x 60 x 1000) = 120000


Forwarding callback of gamemode exit.

pawn Code:
forward OnGamemodeExit(playerid);
Making callback of gamemode changer.

pawn Code:
public OnGamemodeExit(playerid) {
// A command from which the gamemode changes to another.
    SendRconCommand("changemode (You Next GM Name Here)"); // Note: Mansion the right name of you next gamemode. For example you next gamemode is GM2.pwn then write GM2 in this function.
    }
Setting timer in OnGamemodeinit() callback.

pawn Code:
SetTimer("OnGamemodeExit", GamemodeTimer, 0); // GamemodeTimer refers to the time we set in the beginning which is 2 mins or 120 secs.
It's All. You are done.
Thank You.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)