SA-MP Forums Archive
[Tutorial] [Beginner's Tutorial] Gamemode Changing System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] [Beginner's Tutorial] Gamemode Changing System (/showthread.php?tid=445918)



[Beginner's Tutorial] Gamemode Changing System - Champ - 23.06.2013

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.



Re: [Beginner's Tutorial] Gamemode Changing System - Kindred - 23.06.2013

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.


Re: [Beginner's Tutorial] Gamemode Changing System - Champ - 24.06.2013

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


Re: [Beginner's Tutorial] Gamemode Changing System - Salsa - 24.06.2013

didn't understand :/


Re: [Beginner's Tutorial] Gamemode Changing System - SsHady - 27.06.2013

next time Try to be more Specific!!


Re: [Beginner's Tutorial] Gamemode Changing System - K3 - 28.06.2013

Well, I understood it


Re: [Beginner's Tutorial] Gamemode Changing System - Champ - 29.06.2013

newbies can understand it easily.


Re: [Beginner's Tutorial] Gamemode Changing System - SsHady - 29.06.2013

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


Re: [Beginner's Tutorial] Gamemode Changing System - Anak - 29.06.2013

Not much explained but nice.


Re: [Beginner's Tutorial] Gamemode Changing System - Noble - 29.06.2013

"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.