pa3ck Posted October 13, 2013 Share Posted October 13, 2013 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
TAPL Posted October 13, 2013 Share Posted October 13, 2013 Line 17 change whom to who. Link to comment
pa3ck Posted October 13, 2013 Author Share Posted October 13, 2013 Silly mistakes... Thanks man! Link to comment
pa3ck Posted October 13, 2013 Author Share Posted October 13, 2013 I have a question too. Im not able to give more than 1 word for reason. How could I solve this? Link to comment
TAPL Posted October 13, 2013 Share Posted October 13, 2013 https://wiki.multitheftauto.com/wiki/AddCommandHandler Wiki example server side number 2 (click to show it). Link to comment
pa3ck Posted October 13, 2013 Author Share Posted October 13, 2013 Thanks for the quick help, but is it server side only? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now