Jump to content

Table


Msypon

Recommended Posts

why "screen[2]" on line 7?

addEventHandler('onClientRender', root, function() 
    for bone = 1, 54 do 
     local bonePos = {getPedBonePosition(localPlayer, bone)} 
        if bonePos[1] then 
         local screen = {getScreenFromWorldPosition(unpack(bonePos))} 
            if screen[1] then 
             dxDrawText(''..bone, screen[1], screen[2]) 
            end 
        end 
    end 
end) 

Link to comment
  • Moderators

getScreenFromWorldPosition does not return a table. Only 3 floats.

Float

Float is an abreviation of 'Floating Point Number'. A floating point number is one with a decimal point, i.e. it can contain values such as 5.5 or 3.142. An int on the other hand can only hold whole numbers.

Returns

Returns two x, y floats indicating the screen position and float distance between screen and given position if successful, false otherwise

these will probably put in the table. > screen

screen[1] = x

screen[2] = y

screen[3]= distance

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