Gtagasje Posted April 16, 2012 Posted April 16, 2012 Hi, I saw "export function" a while ago in a script, and I don't know what this is. So I got some questions about it. 1. What do exported functions do? 2. Are exported functions helpfull in scripts like police/clan systems? 3. How do you export a function? I hope these can be answered, because I really dont know what exported functions are. Thanks in advance. Gtagasje.
Aibo Posted April 16, 2012 Posted April 16, 2012 exported function is a function (that exists in resource's code) that was exported in resource's meta.xml like this: <export function="functionName" type="server" /> type can be "server" or "client". other resources can call an exported function by using call function. function will be executed in its own resource and (can) return data to the resource that called it. you can read all about it in call wiki page.
mjau Posted April 16, 2012 Posted April 16, 2012 You dont even need to use call function there is a easier way exports["resource-name"]:exportedFunction ( Arguments ) you can make it even simpler variable = exports["resourcename"] variable:exportedFunction(arguments)
drk Posted April 16, 2012 Posted April 16, 2012 And what the problem? just using "exports" it's much more easy.
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