Jump to content

Exported function returns the wrong data type.


Wiebelt

Recommended Posts

Hi,

Im making a resource that connects to a MySQL database and basically wraps all of the functions of MTA MySQL and does some stuff for you.

Also there will be only one MySQL connection.

I have a problem though.

When i call a exported function it returns the data it returns as a string type instead of the original userdata type.

Is it possible to get it as the right type, is this a bug ?

I'll show some code.

From the db resource:

  
-- get mysql_socket  
function get_socket () 
  
    outputChatBox(type(mysql_socket)) 
    return mysql_socket 
  
end 
  

From a different resource:

  
function typeTest (thePlayer) 
    outputChatBox(type(exports.db:get_socket())) 
end 
  
addCommandHandler("tt", typeTest) 
  

The result:

userdata

string

(I'm using the 1.0 nightly.. )

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