Why my MOD crash the server? The Forgotten Server.exe:
Help-me!
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag" version="1.0" author="BomBa" contact="[email protected]" enabled="yes">
<config name="function_config">
<![CDATA[
level = 30
storage = 5748
]]></config>
<event type="kill" name="FragLevelKill" event="script">
<![CDATA[
domodlib('function_config')
function onKill(cid, target, lastHit)
if ((isPlayer(cid) == TRUE) and (isPlayer(target) <= TRUE)) then
if ((getPlayerSkullType(target) == SKULL_NONE) and ((getPlayerLevel(cid) == level)) then
local GUID = getPlayerGUID(cid)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..GUID..") ORDER BY `death_id` DESC LIMIT 1;")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce nao ganhou frag ao matar o "..getPlayerName(target)..".")
doSetCreatureDropLoot(target, 0)
doPlayerSetLossPercent(target, PLAYERLOSS_EXPERIENCE, 0)
setPlayerStorageValue(target, storage, 2)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce ganhou frag ao matar o "..getPlayerName(target)..".")
end
end
return TRUE
end]]></event>
<event type="login" name="FragLevelLogin" event="script">
<![CDATA[
domodlib('function_config')
function onLogin(cid)
registerCreatureEvent(cid, "FragLevelKill")
if getPlayerStorageValue(cid, storage) == 2 then
setPlayerStorageValue(cid, storage, 1)
doSetCreatureDropLoot(cid, 10)
local loss = getConfigValue('deathLostPercent')
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
return TRUE
end]]></event>
</mod>
Help-me!