function onLogout(cid)
local config = {
text = "Text with cancel massage."
summons = getCreatureSummons(cid)
}
if(table.maxn(config.summons) > 0) then
doPlayerSendCancel(cid, config.text)
return false
end
return true
end
Your script send an error to player, but player go log out.LUA:function onLogout(cid) if #getCreatureSummons(cid) >= 1 then doPlayerSendCancel(cid, "You cannot logout for aslong as you have a summon.") end return TRUE end
Your script send an error to player, but player go log out.
It's supposed to send the message and not logout incase there is more or equal to 1 summon
function onLogout(cid)
if #getCreatureSummons(cid) >= 1 then
doPlayerSendCancel(cid, "You cannot logout for aslong as you have a summon.")
return false
end
return true
end
return false
Code:function onLogout(cid) if #getCreatureSummons(cid) >= 1 then doPlayerSendCancel(cid, "You cannot logout for aslong as you have a summon.") return false end return true end
This Working Thanks, i add thisHTML:return false