Battle Logout
vai em data/creaturescripts/scripts, duplica um arquivo e nomeia para "battlelogout" nele cole:
function onLogout(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você não pode deslogar com battle.")
return false
end
return true
end
agora em creaturescripts.xml cole a tag:
<event type="logout" name="BattleLogout" event="script" value="battlelogout.lua"/>
e no arquivo login.lua:
registerCreatureEvent(cid, "BattleLogout")
Cara, fiz tudo o que você mandou, mas mesmo assim ele continua deslogando com Battle...
Está tudo assim:
Battlelogout.lua
function onLogout(cid)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você não pode deslogar com battle.")
return false
end
return true
end
login.lua
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent'))
end
end
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "BattleLogout")
return TRUE
end
craturescripts.xml
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" script="login.lua"/>
<event type="login" name="FirstItems" script="firstitems.lua"/>
<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
<event type="joinchannel" name="GuildMotd" script="guildmotd.lua"/>
<event type="login" name="Conected" script="conected.lua"/>
<event type="logout" name="BattleLogout" event="script" value="battlelogout.lua"/>
</creaturescripts>