Posts: 108
Threads: 15
Joined: Apr 2011
Reputation:
0
Hi SA-MP community, I want to know if I have to destroy the textdraws and timers on OnGameModeExit using KillTimer and TextDrawDestroy, it is necessary?
Thanks.
Posts: 1,177
Threads: 27
Joined: Sep 2011
Reputation:
0
No. All of that is automatically done.
Posts: 108
Threads: 15
Joined: Apr 2011
Reputation:
0
Thanks, yesterday I spoke with a man that said me the opposite, that SA-MP don't do it automatically, so why most scripts of good scripters on OnGameModeExit destroy his timers and textdraws? Thanks for responding.
Posts: 1,177
Threads: 27
Joined: Sep 2011
Reputation:
0
No good scripter does that. If I'm not mistaken, godfather was made that way which is what most roleplay servers use.
Posts: 108
Threads: 15
Joined: Apr 2011
Reputation:
0
iPLEOMAX when you generate a textdraw with his iTD creator the .pwn that generate his tool he destroy the textdraws on OnGameModeExit.
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
I think there's as much reason to do it as there is not to.
Personally, I do it to close off any holes that might occur during Gamemode changing.
Posts: 758
Threads: 7
Joined: Mar 2011
Reputation:
0
To be honest, it depends on what you're using OnGameModeExit for. If you just shut the server down after that, everything is removed anyway. But if it's called because you used something like 'gmx' to restart the gamemode/switch to the next gamemode, then they will stay in memory. Not sure with timers, but in theory they would continue too. Same goes for OnFilterScriptExit and this applies to things like menus, vehicles, objects ect too.
So claiming like "no good scripter does that", like someone did, is just.. Well, I do it and I do it because I used to have terrible crashes because menus weren't destroyed properly. After a while, the menu limit was exceeded, which resulted in a server crash.
Posts: 108
Threads: 15
Joined: Apr 2011
Reputation:
0
Oh thank you so much Joe. Is good listen both parts. Thank you both.