• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Add muted on help channel

Stellow

C++/C#/PHP/LUA
Joined
Oct 23, 2008
Messages
1,106
Reaction score
214
Location
Germany
GitHub
eubrunomiguel
On condition.h:
under:
Code:
CONDITION_EXHAUST_OTHERS = 1 << 26

add:
Code:
CONDITION_TRADE_MUTED = 1 << 27

*obs: dont forget to add a comma after 26 on
Code:
CONDITION_EXHAUST_OTHERS = 1 << 26;

On Condition.cpp:

under:
Code:
case CONDITION_TRADE_MUTED:

add:
Code:
case CONDITION_HELP_MUTED:


ON Chat.cpp:

under:
Code:
if(type == SPEAK_CHANNEL_Y && player->hasFlag(PlayerFlag_TalkOrangeHelpChannel)){
                type = SPEAK_CHANNEL_O;
            }

Add:
Code:
  if(!player->hasFlag(PlayerFlag_CannotBeMuted)){
                if(channelId == CHANNEL_HELP && player->hasCondition(CONDITION_HELP_MUTED)){
                    player->sendCancel("You may only ask something else in two minutes.");
                    return true;
                }

under:
Code:
if(getId() == CHANNEL_TRADE){
        Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_TRADE_MUTED, 120000, 0);
        fromPlayer->addCondition(condition);
    }

add:
Code:
if(getId() == CHANNEL_HELP){
        Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_HELP_MUTED, 120000, 0);
        fromPlayer->addCondition(condition);
    }

* change 120000 for the amount of muted time, 120000 = 2 minutes
*You may only ask something else in two minutes/ you can change for whatever you want
 
Back
Top