23.06.2013, 17:13
(
Last edited by Champ; 24/06/2013 at 07:21 AM.
)
Gamemode Changing System
Simple, Usefull and Easy.
_____________________________________
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.
Mini-Game Servers.
A Very Short Tutorial.
_________________________
↓ Let's Start ↓
Making a variable to set the timer of changing gamemode.
Forwarding callback of gamemode exit.
Making callback of gamemode changer.
Setting timer in OnGamemodeinit() callback.
It's All. You are done.
Thank You.
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);
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.
}
pawn Code:
SetTimer("OnGamemodeExit", GamemodeTimer, 0); // GamemodeTimer refers to the time we set in the beginning which is 2 mins or 120 secs.
Thank You.