I have to destroy the textdraws and timers?
#1

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.
Reply
#2

No. All of that is automatically done.
Reply
#3

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.
Reply
#4

No good scripter does that. If I'm not mistaken, godfather was made that way which is what most roleplay servers use.
Reply
#5

iPLEOMAX when you generate a textdraw with his iTD creator the .pwn that generate his tool he destroy the textdraws on OnGameModeExit.
Reply
#6

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.
Reply
#7

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.
Reply
#8

Oh thank you so much Joe. Is good listen both parts. Thank you both.
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)