I have to destroy the textdraws and timers? -
JavoDiaz - 25.12.2012
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.
Re: I have to destroy the textdraws and timers? -
SuperViper - 26.12.2012
No. All of that is automatically done.
Re: I have to destroy the textdraws and timers? -
JavoDiaz - 26.12.2012
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.
Re: I have to destroy the textdraws and timers? -
SuperViper - 26.12.2012
No
good scripter does that. If I'm not mistaken, godfather was made that way which is what most roleplay servers use.
Re: I have to destroy the textdraws and timers? -
JavoDiaz - 26.12.2012
iPLEOMAX when you generate a textdraw with his iTD creator the .pwn that generate his tool he destroy the textdraws on OnGameModeExit.
Re: I have to destroy the textdraws and timers? -
Joe Staff - 26.12.2012
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.
Re: I have to destroy the textdraws and timers? -
Basssiiie - 26.12.2012
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.
Re: I have to destroy the textdraws and timers? -
JavoDiaz - 26.12.2012
Oh thank you so much Joe. Is good listen both parts. Thank you both.
Re: I have to destroy the textdraws and timers? -
JavoDiaz - 26.12.2012
Quote:
Originally Posted by Basssiiie
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.
|
Now I understand more, thanks.