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

Lua Removeskull

Strashni

minera.servegame.com
Joined
May 10, 2009
Messages
230
Reaction score
0
Location
Montenegro
Hello can someone fix this script..when someone use !removeskull it remove just one frag..how to put there to remove all frags?

Code:
-- how many premium points are needed to take off the red skull
local COST = 100
-- "yes" or "no" // should it also remove all frags?
local REMOVE_FRAGS = "yes"
-- effect to use // you can find the list in data/lib/constant.lua
local EFFECT = CONST_ME_YELLOW_RINGS

function onSay(cid, words, param, channel)

    if getCreatureSkullType(cid) == SKULL_RED then
        local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
        local points = query:getDataInt("premium_points")
        if points >= COST then
            local update = db.executeQuery("UPDATE `accounts` SET `premium_points`= "..(points - COST).." WHERE `id`= " .. getPlayerAccountId(cid) .. "; ")
            if (update == true) then            
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your red skull has been taken off!\nRemaining premium points: " .. (points - COST)) 
                doCreatureSetSkullType(cid, SKULL_NONE)
                if (REMOVE_FRAGS == "yes") then
                    doPlayerSetRedSkullTicks(cid, 0)
                end
                doSendMagicEffect(getPlayerPosition(cid), effect)
            else
                doPlayerSendCancel(cid, "Database error")
            end
            
        else
            doPlayerSendCancel(cid, "You need " ..COST.. " premium points to remove red skull") 
        end
    else
        doPlayerSendCancel(cid, "You do not have red skull")
    end
    
    query:free()
    return TRUE
    
end
 
Why don't you just use the gesiors shop system to remove all frags/redskull by the homepage? It's way better then trading ingame items which some people tend to dupe.
 
Back
Top