Jump to content

Calling exported functions


Drakath

Recommended Posts

  • MTA Team

Make a resource (e.g. client-api), which has an exported function, which would triggerClientEvent it to the player and then call it (still from that client-api resource).

The "client-api" needs 3 parameters: string targetResource, string exportedFunction, table parameters

Link to comment

Now I have another problem. I have called a function with a text argument. In that function I addEventHandler for another function but I also need to pass this text to that function. addEventHandler does not allow custom arguments. How can I work around it?

Link to comment

Not sure what you mean.

Here's the script:

addEvent("myEvent", true) 
function asdf(text) 
addEventHandler ( "onClientRender", root, draw ) 
end 
addEventHandler("myEvent", root, asdf) 
  
function draw (text) 
blablabla... 

How can I pass text to function draw?

Function asdf receives text from server-side script.

Link to comment

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