• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Some outfits dont appear/Scripts improvement

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
Hello, my ot is version 10.99+ and tfs 1.2

----- Help number 1

in my outfits.xml have the outfits configured:

Code:
<outfit type="0" looktype="900" name="Lupine Warden" premium="no" unlocked="yes" enabled="yes" />
 <outfit type="0" looktype="909" name="Grove Keeper" premium="no" unlocked="yes" enabled="yes" />

<outfit type="1" looktype="899" name="Lupine Warden" premium="no" unlocked="yes" enabled="yes" />
 <outfit type="1" looktype="908" name="Grove Keeper" premium="no" unlocked="yes" enabled="yes" />
But when I click to change outfits the outfits above dont appear, why this? Dont debbug (only dont appear for change).

I using this item.otb
https://github.com/malucooo/Otxserver-Testing/blob/master/data/items/items.otb

Any idea?

----- Help number 2

Is for mute on channel Help, but when player die or up some level, he can talk again on channel Help, why? Have fix for this? how?

Code:
function onSay(cid, words, param)

    local CHANNEL_HELP = 7
    local player = Player(cid)
    local storage = 456112

    if words == "/mute" then
        local mute = param:split(",")

        if mute[1] == nil or mute[1] == " " then
            player:sendCancelMessage("Invalid player specified.")
            return false
        end

        if mute[2] == nil or mute[2] == " " then
            player:sendCancelMessage("Invalid time specified.")
            return false
        end

        local target = Player(mute[1])
        local time = tonumber(mute[2])
        local condition = Condition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT)
        condition:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
        condition:setParameter(CONDITION_PARAM_TICKS, time*60*1000)

        if player:getAccountType() < ACCOUNT_TYPE_TUTOR then
            return false
        end

        if target == nil then
            player:sendCancelMessage("A player with that name is not online.")
            return false
        end

        if target:getAccountType() >= ACCOUNT_TYPE_TUTOR then
            player:sendCancelMessage("Only player can be mutated")
            return false
        end

        target:addCondition(condition)
        sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, target:getName() .. " has been muted by " .. player:getName() .. " for using Help Channel inappropriately.")
        target:setStorageValue(storage, 1)
        return false
    end

    if words == "/unmute" then

        local remove = Player(param)

        if player:getAccountType() < ACCOUNT_TYPE_TUTOR then
            return false
        end

        if remove == nil then
            player:sendCancelMessage("A player with that name is not online.")
            return false
        end

        if remove:getAccountType() >= ACCOUNT_TYPE_TUTOR then
            return false
        end

        if remove:getStorageValue(storage) == 1 then
            remove:removeCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP)
            sendChannelMessage(CHANNEL_HELP, TALKTYPE_CHANNEL_R1, remove:getName() .. " has been unmuted by " .. player:getName() .. ".")
            remove:setStorageValue(storage, -1)
        else
            player:sendCancelMessage("A player " .. remove:getName() .. "is not mutated")
        end
    end

    return false
end

----- Help number 3

I need to put an exhausted on EquipItems (my equip hotkey is with C++ on sourcer, but I dont know what archive is :/)
I already put the exhausted on player.lua but I need now in sourcers too (when player use hotkey equip), if someone know where is the archive for equip hotkey on sourcer tell me and I post here, thanks all who will help

skype: [email protected]
 
Solution
Yes, just track the data you need (like timestamp + cooldown) as a player storage value, which you can retrieve and check in onLogin to determine if player still needs to be muted.

(if login timestamp has a lower value than the earlier set player storage value which was set to timestamp + cooldown, then the player should still be muted for (earlier timestamp + cooldown) - (current timestamp) seconds.

Edit:
You can do this here: https://github.com/otland/forgottenserver/blob/master/data/creaturescripts/scripts/login.lua
Mute channel:
I think the player loses his mute condition on logout. You need to add a onLogin check in creaturescript that re-applies the channel mute for the remainer of the mute duration if the player is still muted.
 
Mute channel:
I think the player loses his mute condition on logout. You need to add a onLogin check in creaturescript that re-applies the channel mute for the remainer of the mute duration if the player is still muted.

How check in? players lose onDeath

But how I can make this script when login?
 
Yes, just track the data you need (like timestamp + cooldown) as a player storage value, which you can retrieve and check in onLogin to determine if player still needs to be muted.

(if login timestamp has a lower value than the earlier set player storage value which was set to timestamp + cooldown, then the player should still be muted for (earlier timestamp + cooldown) - (current timestamp) seconds.

Edit:
You can do this here: https://github.com/otland/forgottenserver/blob/master/data/creaturescripts/scripts/login.lua
 
Last edited:
Solution
Back
Top