DriFtyZ

[BUG] Failed to call [string "?"]

Recommended Posts

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


 

Share this post


Link to post

and the meta of the resource you are calling? (since you have to enable export functions there)

Share this post


Link to post

<exports function="showErrorCode" type="server" />

 

 

It might looks messed because im from my phone

Share this post


Link to post
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]

Share this post


Link to post

Also keep in mind that exported server functions can only be called from only server side files!

Share this post


Link to post

The brackets wasn't a problem i tried it without them before, anyways ill try the "call" way and let you know

Edited by DriFtyZ

Share this post


Link to post

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.