DriFtyZ Posted June 15, 2017 Posted June 15, 2017 Exact what the title says, i can't figure it out what is wrong with a simple exports code im testing, thanks! error: Failed to call '[DWN]Core:showErrorCode'[string "?"] code to call the function: exports["[DWN]Core"]:showErrorCode(player, "02") code of the exported function: function showErrorCode (player, int) if player then if int == "02" then -- Some random code to excecute here outputChatBox("It Works!") end end end
Moderators IIYAMA Posted June 15, 2017 Moderators Posted June 15, 2017 and the meta of the resource you are calling? (since you have to enable export functions there)
DriFtyZ Posted June 15, 2017 Author Posted June 15, 2017 <exports function="showErrorCode" type="server" /> It might looks messed because im from my phone
Moderators IIYAMA Posted June 15, 2017 Moderators Posted June 15, 2017 call(getResourceFromName("[DWN]Core"), "showErrorCode", player, "02) Try to use call instead. The exports function does not always work correctly, I haven't figured out the reason of that. Btw it is not recommended to use special characters in your resources names. [DWN]Core Those brackets are used to make folders invisible for the server. [invisible]
Hale Posted June 15, 2017 Posted June 15, 2017 Also keep in mind that exported server functions can only be called from only server side files!
DriFtyZ Posted June 16, 2017 Author Posted June 16, 2017 (edited) The brackets wasn't a problem i tried it without them before, anyways ill try the "call" way and let you know Edited June 16, 2017 by DriFtyZ
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