Jump to content

Ce e mai rapid public sau function?6


valivaly96

Recommended Posts

Functiile oferite de sa-mp.

Doar in 3 cazuri ar trebui sa definesti o functie pe care o faci ,public. In cazul in care folosesti un timer, folosesti mysql_t/pquery sau vrei sa chemi functia prin CallRemoteFunction/CallLocalFunction. Astea sunt singurele cazuri. Si din cate am vazut function din gm-uri este exact un public dar nu trebuie sa te mai complici sa scrii o linie in plus.

Dar nu, functiile declarate public nu au efect asupra vitezei(sau e inisemnificativ). Ele sunt salvate in memoria amx pentru a putea fi folosite de metodele zise mai sus.

Sfatul meu este daca nu folosesti functia pentru unul din cazurile de mai sus, mai bine las-o fara public/function(ambele sunt la fel din cate am vazut la definirea function)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.