Stevenn Posted June 30, 2012 Posted June 30, 2012 Hello, I have this script: Client: function randomTest(text) guiSetText (myLabel, text) end addEvent("randomTest", true) addEventHandler("randomTest", root, randomTest) Client: triggerClientEvent(source,"randomTest", root, "the text") But how can I make it a exported function? So I could use something like: exports["setText"] : randomTest ( "my text??" ) -- server exports["setText"] : randomTest ( source, "my text??" )
50p Posted June 30, 2012 Posted June 30, 2012 This exports functions from this resource, so other resources can use them with callfunction: The function name type Whether function is exported server-side or client-side (valid values are: "server" and "client") http: Can the function be called via HTTP (true/false) - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Stevenn Posted June 30, 2012 Author Posted June 30, 2012 This exports functions from this resource, so other resources can use them with callfunction: The function name type Whether function is exported server-side or client-side (valid values are: "server" and "client") http: Can the function be called via HTTP (true/false) Ok, so I added to the meta and then exports ["testResource"] : randomTest("test") but no result
Castillo Posted June 30, 2012 Posted June 30, 2012 You can't use a client side exported function in a server side script. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Stevenn Posted June 30, 2012 Author Posted June 30, 2012 You can't use a client side exported function in a server side script. I know, it is a client script
Castillo Posted June 30, 2012 Posted June 30, 2012 I don't understand what is your problem. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now