Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Recommended Posts

Posted (edited)

Stiu ca sunt functii simple pe care le folosim mereu dar care este diferenta ditre cele doua functii de mai jos?

CallLocalFunction

CallRemoteFunction

Si mai important de ce se folosesc aceste funtii cand putem folosi direct asa functia?

callMe(2,4);

 

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Posted

http://wiki.sa-mp.com/wiki/CallRemoteFunction

http://wiki.sa-mp.com/wiki/CallLocalFunction

 

CallRemoteFunction - ”Calls a public function in any script that is loaded.” - asta cheama o functie din orice script care e incarcat;

CallLocalFunction - "Calls a public function from the script in which it is used." - asta cheama doar din script-ul folosit.

De acel callMe nu stiu nimic.

 

 

Posted (edited)

Apelarea directa o poti folosi cand stii daca functia respectiva exista si stii numele functiei la momentul compilarii. Este cea mai rapida metoda.

CallLocalFunction() o folosesti cand nu stii numele functiei la momentul compilarii; se apeleaza doar functia din modul curent (gm/fs). Este o metoda mai lenta pentru ca la fiecare folosire a CallLocalFunction, server-ul cauta in memorie zona alocata functiei pentru a o "chema".

Un exemplu al folosirii CallLocalFunction() este zcmd.

CallRemoteFunction() o folosesti cand nu stii numele functiei la momentul compilarii SI/SAU functia se afla in alt mod (gm/fs); se apeleaza toate functiile cu acest nume. Este lenta din acelasi motiv.

* Functiile "chemate" prin CallRemoteFunction() si CallLocalFunction() trebuie sa fie "forward-ate".

Edited by Spman

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.