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

RevScripts Frag & Skill Remover

GM Ambera

GM Ambera
Joined
Dec 19, 2018
Messages
61
Reaction score
8
Hello !!
Im using this action

Code:
 local removeSkull = Action()

function removeSkull.onUse(player, item, fromPos, target, toPos, isHotkey)
    local playerPos = player:getPosition()
    local tile = Tile(playerPos)
    if not tile or not tile:hasFlag(TILESTATE_PROTECTIONZONE) then
        player:sendCancelMessage("You can use only in pz.")
        return true
    end

    if player:getSkullTime() == 0 then
        player:sendCancelMessage("You don't have skull time.")
        return true
    end

    player:setSkullTime(0)
    player:setSkull(SKULL_NONE)
    playerPos:sendMagicEffect(CONST_ME_MORTAREA)
    player:say("Remove Skull!")
    item:remove(1)
    return true
end

removeSkull:id(9969)
removeSkull:register()

But when i kill 1 people they got other time Red Skull.
 
Acording to Player::addUnjustifiedDead(const Player* attacked) logic it simply checks:
C++:
g_config.getNumber(ConfigManager::KILLS_TO_RED) != 0 &&
skullTicks > (g_config.getNumber(ConfigManager::KILLS_TO_RED) - 1) *static_cast<int64_t>(g_config.getNumber(ConfigManager::FRAG_TIME))
You could in adition call player:save() but I belive setSkullTime(0) already modified skullTicks. I'd simply try to open it with Visual Studio debugger and check why all these conditions are met.
And MOST important, which distro you're using?
 
Last edited:
Acording to Player::addUnjustifiedDead(const Player* attacked) logic it simply checks:
C++:
g_config.getNumber(ConfigManager::KILLS_TO_RED) != 0 &&
skullTicks > (g_config.getNumber(ConfigManager::KILLS_TO_RED) - 1) *static_cast<int64_t>(g_config.getNumber(ConfigManager::FRAG_TIME))
You could in adition call player:save() but I belive setSkullTime(0) already modified skullTicks. I'd simply try to open it with Visual Studio debugger and check why all these conditions are met.
And MOST important, which distro you're using?
Canary already fixed thanks.
 
Back
Top