zapo
Member
- Joined
- Nov 10, 2020
- Messages
- 129
- Solutions
- 3
- Reaction score
- 11
Skrypt usuwa skulla, ale fragi pozostają, mianowicie gdy zabije jedną osobę od razu red skull
Po użyciu nie usuwają się fragi.
Po użyciu nie usuwają się fragi.
Lua:
function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local tile = Tile(player:getPosition()):hasFlag(TILESTATE_PROTECTIONZONE)
if not tile then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be in protection zone to use this item.")
return true
end
if isInArray({SKULL_RED, SKULL_BLACK}, player:getSkull()) then
player:setSkull(SKULL_NONE)
player:setSkullTime(0)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your skull has been removed!")
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
--db.query("UPDATE `players` SET `skulltime` = 0 WHERE `id` = " .. player:getGuid())
item:remove(1)
player:remove()
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You can only remove red or black skulls!")
player:getPosition():sendMagicEffect(CONST_ME_POFF)
end
return true
end