1000+ public functions
#1

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

Depends upon your intention
Reply
#3

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

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)
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)