function onPrepareDeath(cid, killer)
doSetCreatureDropLoot(cid, false)
return true
end
function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
loot = false, -- se ao morrer o jogador irá perder o loot
level = 10000 -- até que level irá proteger o player
}
if isPlayer(cid) and getPlayerLevel(cid) <= config.level then
if config.onlypremium == true and not isPremium(cid) then return TRUE end
if config.loot == false then doCreatureSetDropLoot(cid, false) end
return TRUE end return TRUE end
registerCreatureEvent(cid, "ProtectLevel")
registerCreatureEvent(cid, "ReportBug")
<event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/>