Jump to content

Userdata value?


pa3ck

Recommended Posts

Oh hello there, I got some problem with this little code I wrote.

function jail(cmd, who, jailtimet, reason) 
    local whom = getPlayerFromName(who) 
    local jailtime = tonumber(jailtimet) 
     
    function release() 
        setElementInterior(whom, 0) 
        setElementPosition(whom, 1552.95630, -1675.40747, 16.1953) 
    end 
     
    if whom then 
        if jailtime then 
            if reason then 
                local theadmin = getPlayerName(getLocalPlayer()) 
                setElementInterior(whom, 6) 
                setElementPosition(whom, 264.19745, 77.76832, 1001.03906) 
                setTimer(release, jailtime * 1000, 1) 
                outputChatBox('Successfully jailed ' .. whom .. ' for ' .. jailtime .. ' sec. Reason: ' ..reason, 0, 255, 0) 
                triggerServerEvent('jailed', getRootElement(), jailtime, reason, whom, theadmin) 
            else 
                outputChatBox('Reason?') 
            end 
        else 
            outputChatBox('Jail time?') 
        end 
    else 
        outputChatBox('Who?') 
    end 
  
end 
addCommandHandler('jail', jail) 

The problem is, that for variable 'whom' I get a userdata value... Its something like 00000006F. Why is that?

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