Candlejack
Don't hug me I'm scared
I am getting an error when using mayNotMove function. Anyone know why? I'm using TFS 1.0
The problem code is: mayNotMove(itemEx.uid, true)
The problem code is: mayNotMove(itemEx.uid, true)
Code:
local config = {
timee = 60000 -- Seconds
}
local function allowMovement(cid)
if not isPlayer(cid) then
return
end
mayNotMove(cid, false)
setPlayerStorageValue(cid,4455,0)
end
local function unCuff(cid)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Handcuffs have come unloosed. You are no longer restrained.')
end
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
if isPlayer(itemEx.uid) then
if getPlayerStorageValue(itemEx.uid,4455) == 1 then
setPlayerStorageValue(itemEx.uid,4455,2)
end
mayNotMove(itemEx.uid, true)
addEvent(allowMovement, config.timee, itemEx.uid)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You have restrained '..getPlayerName(itemEx.uid)..'.')
doPlayerSendTextMessage(itemEx.uid,MESSAGE_INFO_DESCR,'You are being restrained by '..getPlayerName(cid)..'.')
addEvent(unCuff, config.timee-3000, itemEx.uid)
doRemoveItem(item.uid,1)
end
return true
end