SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 14/07/2012, 08:08 AM   #1
Universal
Huge Clucker
 
Universal's Avatar
 
Join Date: Jan 2010
Posts: 484
Reputation: 27
Default OnGameModeExit is not being called

Hi guys, I have lots of systems which needs to be saved upon server shutdown (house owners, business data, etc.), but how am I supposed to do this, when this callback is not being called as it should be (atlest its name tells that its supposed to be called upon game mode exit)? Or is there any other way to do this?

PS. I remeber doing this before and it worked, and some people also use TextDrawDestroy() in this callback (and they recommend others doing so), but whats the point if this callback is useless?

Thanks in advice.
Universal is offline   Reply With Quote
Old 14/07/2012, 08:34 AM   #2
clarencecuzz
Gangsta
 
Join Date: Jul 2010
Location: Australia
Posts: 940
Reputation: 89
Default Re: OnGameModeExit is not being called

If your server crashes, sometimes it will not call OnGameModeExit, I would recommend you set a timer to save these systems, obviously not for TextDrawDestroy etc.

Not sure what other things might affect OnGameModeExit... other than the timer, I cannot think of any other way to save it apart from OnGameModeExit.
clarencecuzz is offline   Reply With Quote
Old 14/07/2012, 10:30 AM   #3
[KHK]Khalid
Gangsta
 
Join Date: Jan 2012
Location: The Arab Republic of Egypt
Posts: 762
Reputation: 114
Default Re: OnGameModeExit is not being called

It's being called when the gamemode ends (e.g when you close the samp-server.exe or use GameModeExit). If it's not being called in your script, then there should be a problem

# Maybe you're using the script as a filterscript not as a gamemode.
# Maybe the server crashes right before this callback is called (Check this crash detect plugin).
# Maybe it's being called but you probably saving stuff wrongly (Have you tried log prints to debug?).

Oh I got a question. How did you know that it's not being called?
[KHK]Khalid is offline   Reply With Quote
Old 14/07/2012, 04:04 PM   #4
Universal
Huge Clucker
 
Universal's Avatar
 
Join Date: Jan 2010
Posts: 484
Reputation: 27
Default Re: OnGameModeExit is not being called

Because I tried printing stuff, and had nothing at all. Had like 6 print's before every function.
Universal is offline   Reply With Quote
Old 14/07/2012, 04:55 PM   #5
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,216
Reputation: 311
Default Re: OnGameModeExit is not being called

Make a restart command to restart the server right after saving. You can achieve a server restart by doing one of the following:

pawn Code:
SendRconCommand("gmx");

pawn Code:
GameModeExit();
__________________
Release NameUse
FairPlayKeep the cheaters out of your server
Object Model ArrayArray of every single object model in the game
RCON PanelControl any server as you like with RCON controls
SlopeClimb up a steep hill against other players with cars falling down

I do not play on any SAMP server. Anyone with the name Ricky Phelps in-game is an imposter.
SuperViper is offline   Reply With Quote
Reply

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
OnGameModeExit(); NeroX98 Scripting Help 6 10/06/2012 10:50 AM
OnGameModeExit and OnFilterScriptExit [HELP] Sting. Scripting Help 5 10/04/2012 04:21 AM
OnGameModeExit Asasi Română/Romanian 12 31/05/2011 07:38 PM
[Bug] OnGameModeExit scottyishere Help Archive 2 14/12/2010 01:21 PM
OnGameModeExit GaGlets(R) Help Archive 4 28/11/2010 12:55 AM


All times are GMT. The time now is 01:35 PM.


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