1000+ public functions - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: 1000+ public functions (
/showthread.php?tid=626963)
1000+ public functions -
X337 - 22.01.2017
Hello, today i've noticed that my gamemode has 1025 public functions.
My question is, is it a normal thing for a gamemode having that much public functions?
Thanks in advance.
Re: 1000+ public functions -
GhostHacker9 - 22.01.2017
Depends upon your intention
Re: 1000+ public functions -
Vince - 22.01.2017
I don't think they have any impact on performance, but since the names of public functions are stored in memory this might result in increased memory usage. A function should only be public if either:
- It is a callback
- It is called by a timer
- It is called by CallLocalFunction
- It is called by CallRemoteFunction
In any other case it's unnecessary. If you used a tool to count them then keep in mind that ZCMD commands are also public functions because ZCMD uses CallLocalFunction in the background.
Re: 1000+ public functions -
xTURBOx - 22.01.2017
Public functions can be called via CallLocalFunction, CallRemoteFunction, SetTimer, and SetTimerEx.
usage: When creating a timer or a callback
use normal functions whenever you can(dont need to call a timer,etc)
Re: 1000+ public functions -
oMa37 - 22.01.2017
Quote:
Originally Posted by xTURBOx
Public functions can be called via CallLocalFunction, CallRemoteFunction, SetTimer, and SetTimerEx.
usage: When creating a timer or a callback
use normal functions whenever you can(dont need to call a timer,etc)
|
That's basically what
Vince already said ...
Re: 1000+ public functions -
X337 - 22.01.2017
As far as it doesn't impact on gamemode performance, i think it shouldn't be a problem. But i will keep look out for memory usage.
Thank you so much for your help guys.