[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
#2

Not a tutorial. Nothing is explained. You're simply telling them to copy and paste.

You don't even explain how to check what gamemode they are currently in, and so forth, which may be essential for several scripts.
Reply
#3

Sorry, but this is my first tutorial so that i explained as much as i could.
Reply
#4

didn't understand :/
Reply
#5

next time Try to be more Specific!!
Reply
#6

Well, I understood it
Reply
#7

newbies can understand it easily.
Reply
#8

Understand? Your just Showing Them the script?
Not teaching Them how it works and blah blah
Tutorials means To teach not to just paste the code
Reply
#9

Not much explained but nice.
Reply
#10

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

You could either #define GamemodeTimer or use const instead of new as the value is always constant.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)