• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Red Skull Remover Bug

MxSoft

Leave Tibia, Live Life.
Joined
Dec 22, 2009
Messages
1,804
Solutions
1
Reaction score
43
Location
Mexico
Hi in my ots shop, if someone for error buy it ONLINE they dont get of the skull, but in page dont says nothing about loggin off.....How can i fix this ?
 
I have this mod

<?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), "Leave Skull!", 180)
doCreatureSetSkullType(cid,0)
doPlayerSetSkullEnd(cid, 0, playerSkull)
doRemoveItem(item.uid, 1)
end
return true
]]></action>
</mod>
 
I use this

on data/actions/scripts skullremove.lua
Code:
function onUse(cid, item, frompos, item2, topos)
       
        local nonremskulls =    -- These are the skulls it cant remove. If player has any of these, the rune wont work.
{
        white = SKULL_WHITE
}

        if isInArray(nonremskulls, getPlayerSkullType(cid)) then
                doPlayerSendCancel(cid,"You can't remove this type of skull.")
                doSendMagicEffect(getPlayerPosition(cid),2)
        else
                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 & your skull have been removed, thanks for donating!")
                doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
				doSendAnimatedText(getPlayerPosition(cid), "Removed!", 180)
                doRemoveItem(item.uid, 1)
        return TRUE
        end
end

and on data/actions/actions.xml
Code:
<action itemid="ID ITEM" script="skullremove.lua"/>

i think will work
 
Back
Top