Hey i got this script that removes skulls and frags but i want it to just remove red skulls and frags but when they use this they frags dosent go away!
using 0.4 dev
script:
using 0.4 dev
script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
local creatureSkull = getCreatureSkullType(itemEx.uid)
local playerPos = getCreaturePosition(itemEx.uid)
if creatureSkull == 4 or creatureSkull == 5 then
if creatureSkull == 4 then
doPlayerSetSkullEnd(itemEx.uid, 0, SKULL_RED)
if cid ~= itemEx.uid then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed a red skull.")
end
doPlayerSendTextMessage(itemEx.uid, MESSAGE_STATUS_CONSOLE_BLUE, "Your red skull and frags have been removed.")
elseif creatureSkull == 5 then
doPlayerSetSkullEnd(itemEx.uid, 0, SKULL_BLACK)
if cid ~= itemEx.uid then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed a black skull.")
end
doPlayerSendTextMessage(itemEx.uid, MESSAGE_STATUS_CONSOLE_BLUE, "Your black skull and frags have been removed.")
end
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(itemEx.uid) .. ")")
doSendMagicEffect(playerPos, CONST_ME_MAGIC_RED)
doPlayerSave(itemEx.uid)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doPlayerSendCancel(cid, "This player do not have a red skull or a black skull!")
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "Sorry, not possible.")
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
return true
end