<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Hermes" contact="otland.net" enabled="yes">
<action itemid="9969" event="script"><![CDATA[
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getPlayerSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSendTextMessage(cid, 27, "Your frags & your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
]]></action>
</mod>
<action itemid="9969" event="script"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Frag Remover" version="1.1" author="Arthur" contact="otland.net" enabled="yes">
<action itemid="xxxx" event="script"><![CDATA[
local noRemove = {SKULL_WHITE, SKULL_YELLOW}
local playerSkull = getPlayerSkullType(cid)
if isInArray(noRemove, playerSkull) then
doPlayerSendCancel(cid, "You can't remove this type of skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
elseif playerSkull == SKULL_NONE then
doPlayerSendCancel(cid, "You don't have skull.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
else
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSendTextMessage(cid, 27, "Your frags and your skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "Removed !", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
]]>
</action>
</mod>
Are you ridiculous? Why would you put
in anything? It's a mod, and gets put into a MOD folder. There is no XML file to call it........XML:<action itemid="9969" event="script">
And the itemID is already called in the script.
Anyway, TKO use mine.![]()
![]()
That's the part of the mod, and he told him he can edit it if he wants to use another item (not add!)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreatureSkullType(cid) == SKULL_RED then
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doCreatureSetSkullType(cid,0)
doPlayerSendTextMessage(cid,27,"Your frags and skull have been removed!")
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
doRemoveItem(item.uid, 1)
doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
else
doPlayerSendCancel(cid, "You do not have a red skull.")
doSendMagicEffect(getPlayerPosition(cid),2)
end
return TRUE
end
<action itemid="9969" event="script" value="fragrune.lua"/>
local config =
{
item = xxxx, //ITEM ID
level = xxxx,
count = 0
}
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= config.level then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your frags have been removed.")
doRemoveItem(item.uid)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)
doPlayerSetSkullEnd(cid, 0, SKULL_BLACK)
else
doPlayerSendCancel(cid, "You dot have enough level")
end
return TRUE
end