• 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!

Help to this SCRIPT

Piltrafa

Active Member
Joined
Nov 10, 2010
Messages
654
Reaction score
29
hello guys.

I want to put on this scripts thats players can remove skull only if not have PZ.

Code:
function onUse(cid, item, frompos, item2, topos)
 
        local nonremskulls = -- 
{
        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)
				doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
 
        return TRUE
        end
end

Anyone can do it?
Thanks and rep++
 
LUA:
if (hasCondition(cid, CONDITION_INFIGHT) == FALSE) then

Merged:
LUA:
function onUse(cid, item, frompos, item2, topos)
 
        local nonremskulls = -- 
{
        white = SKULL_WHITE
}
 
        if isInArray(nonremskulls, getPlayerSkullType(cid)) then
                doPlayerSendCancel(cid,"You can't remove this type of skull.")
                doSendMagicEffect(getPlayerPosition(cid),2)
        else
            if (hasCondition(cid, CONDITION_INFIGHT) == FALSE) 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 & your skull have been removed, thanks for donating!")
                doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_RED)
				doSendAnimatedText(getPlayerPosition(cid), "Removed!", 180)
                doRemoveItem(item.uid, 1)
				doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
	        else
	            doPlayerSendCancel(cid,"You cannot remove your skull with PZ lock")
            end
 
        return TRUE
        end
end
 
Last edited:
Back
Top