Jump to content

Converting integer to string


Recommended Posts

To add onto what KariiM said, tostring() converts anything into a string.

local plr = getPlayerFromName("Noki") 
tostring(isPedOnGround(plr)) 

will return either "true" or "false"

tostring(getPlayerFromName("Noki")) 

will return a string with the player element of a player named 'Noki'

tostring() converts anything into a string

However, tonumber() will either return a number (float or integer) or nil if invalid arguments were passed

tonumber(dxGetStatus()) 

will return nil as you cannot convert a table to an integer

tonumber("12") 

will return 12 as an integer

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