Jump to content

Calling function "getRunningGamemode" returns userdata?


AfuSensi

Recommended Posts

Hi,

I'm trying to call the function "getRunningGamemode" to detect what gamemode the current map is.

But it returns userdata instead of the gamemode.

I have no idea what userdata is.

I use this to call the function:

gamemode = call(getResourceFromName("mapmanager"), "getRunningGamemode") 
outputChatBox(tostring(gamemode)) 

Returns: userdata: 020000F5

https://wiki.multitheftauto.com/wiki/Map ... _functions

Link to comment

There are eight basic data types in Lua: nil, boolean, number, string, userdata, function, thread, and table.

Userdata are used to represent new types created by MTA such as player, vehicle, objects or even xml nodes. That's the way you can represent those elements in lua, as they are not native of the language.

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