SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 20/12/2011, 03:25 AM   #1
Ballu Miaa
Ballu Miaa's Avatar
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,882
Reputation: 315
Default Game Mode change Bug help![rep+]

I have a TDM server , My script restart's the server/change's the GM after every 30 mins! It give's BattleWin message's and save score's! Everything use to work well. But now if noone logs into the server when a Round start's of 30 minutes. The server doesnt restart automatically! It works when i go InGame and check everything. But when there is noone in the server it doesnt do anything! I've set lot of timers to Change the game mode after 30 Minutes if one timer doesnt change it. But no helps nothing works if no one in the server.
I've used both SendRconCommand("changemode CWLS") as well as GameModeExit() , I dont know what is wrong. This function use to work well! Please help

// Under OnGameModeInit()
SetTimer("GameModeChanger", 30 * 60 * 1000, 0);

forward GameModeChanger();
public GameModeChanger()
    for(new i = 0; i < MAX_PLAYERS; i++)
			SendClientMessage(i, 0x66a2ff97,"* The Next Battle will start soon, dont keep your weapons away!");
			TogglePlayerControllable(i, 0);
			new Float:B,Float:C,Float:D;
			SetTimer("Changemode", 10 * 1000 , 0);
            dini_IntSet("CW/Scores.txt", "IndiaScore", IndiaScore);
            dini_IntSet("CW/Scores.txt", "USScore", USScore);
            dini_IntSet("CW/Scores.txt", "RusScore", RusScore);
            dini_IntSet("CW/Scores.txt", "PakScore", PakScore);
            dini_IntSet("CW/Scores.txt", "UKScore", UKScore);
forward Changemode();
public Changemode()
    SendRconCommand("changemode CWLS");
    return 1;

I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 20/12/2011, 03:44 AM   #2
Huge Clucker
JamesC's Avatar
Join Date: Jul 2010
Location: New Zealand
Posts: 242
Reputation: 31
Default Re: Game Mode change Bug help![rep+]

Take SetTimer("Changemode", 10 * 1000 , 0); out of the loop. If you call it there, it will only work if a player is connected. Also, You don't need to set a timer. Just save all the data, then call the Changemode function.

JamesC is offline   Reply With Quote
Old 20/12/2011, 05:36 AM   #3
Posts: n/a
Default Re: Game Mode change Bug help![rep+]

You are using the timer inside the loop. Take it out of the loop to the head of the call back and you are done.
  Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change game-mode and add admins commands to samp Polomikey Server Support 16 03/12/2011 07:40 PM
Server Mode Change Help! eеe Scripting Help 4 20/11/2011 01:04 PM
How do I change game-mode name? Andy_McKinley Help Archive 1 06/11/2009 10:25 AM

All times are GMT. The time now is 02:23 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.