Jump to content

attempt to concatenate local 'padz' (a nil value)


Padul

Recommended Posts

Posted
  
function forObjPosition ( thePlayer, command ) 
    local padx,pady,padz = getElementPosition ( thePlayer ) 
    outputConsole ( "{" .. padx .. "," .. pady .. "," .. padz .. "}," ) 
end 
addCommandHandler("mypos",forObjPosition) 

What had i done bad?

MTA Dayz textures and objects: http://padulmods.blogspot.com/

Posted

Try this :

-- server side

function forObjPosition ( thePlayer, command ) 
    if thePlayer and isElement(thePlayer) then  
        local padx,pady,padz = getElementPosition(thePlayer) 
        outputChatBox ("{" .. padx .. "," .. pady .. "," .. padz .. "}",thePlayer,0,255,0) 
    end  
end 
addCommandHandler("mypos",forObjPosition) 

if you are trying to use this code client side just remove the argument thePlayer and replace it in your code with localPlayer.

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

Nothing was wrong with your code. It was just outputting it to the console.

There's really no need for "if thePlayer and isElement(thePlayer) then" with onCommandHandler.

Discord: its.tails

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