AS the topic says, is it possible to modify the TFS 0,2 sources to allow only 2 messages each minute from a player in the help channel?
Or is there an easier way to do this?
Or is there an easier way to do this?
if(!fromPlayer->hasFlag(PlayerFlag_CannotBeMuted) && (m_id == 0x05 || m_id == 0x06))
{
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_TRADETICKS, 120000, 0);
fromPlayer->addCondition(condition);
}
if(!fromPlayer->hasFlag(PlayerFlag_CannotBeMuted) && (m_id == 0x05 || m_id == 0x06 || m_id == 0x08))
{
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_TRADETICKS, 120000, 0);
fromPlayer->addCondition(condition);
}
if(player->hasCondition(CONDITION_TRADETICKS) && (channelId == 0x05 || channelId == 0x06))
{
player->sendCancel("You may only place one offer in two minutes.");
return false;
}
if(player->hasCondition(CONDITION_TRADETICKS) && (channelId == 0x05 || channelId == 0x06 || channelId == 0x08))
{
player->sendCancel("You may only send one message in two minutes.");
return false;
}
if(player->hasCondition(CONDITION_TRADETICKS) && (channelId == 0x05 || channelId == 0x06))
{
player->sendCancel("You may only place one offer in two minutes.");
return false;
}
else if(player->hasCondition(CONDITION_HELPTICKS) && (channelId == 0x08))
{
player->sendCancel("You may only speak every two minutes in this channel.");
return false;
}
case CONDITION_TRADETICKS:
case CONDITION_HELPTICKS:
ONDITION_EXHAUST_HEAL = 16777216,
CONDITION_HELPTICKS = 33554432
Condition* conditionTrade = player->getCondition(CONDITION_TRADETICKS, CONDITIONID_DEFAULT);
if(conditionTrade && conditionTrade->getTicks() > 0)
{
conditionTrade->setTicks(conditionTrade->getTicks() - (time(NULL) - player->getLastLogout()) * 1000);
if(conditionTrade->getTicks() <= 0)
player->removeCondition(conditionTrade);
else
player->addCondition(conditionTrade->clone());
}
Condition* conditionHelp = player->getCondition(CONDITION_HELPTICKS, CONDITIONID_DEFAULT);
if(conditionHelp && conditionHelp->getTicks() > 0)
{
conditionHelp->setTicks(conditionHelp->getTicks() - (time(NULL) - player->getLastLogout()) * 1000);
if(conditionHelp->getTicks() <= 0)
player->removeCondition(conditionHelp);
else
player->addCondition(conditionHelp->clone());
}
CONDITION_HELPTICKS = 33554432
if(!fromPlayer->hasFlag(PlayerFlag_CannotBeMuted) && (m_id == 0x05 || m_id == 0x06))
{
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_TRADETICKS, 120000, 0);
fromPlayer->addCondition(condition);
}
if(!fromPlayer->hasFlag(PlayerFlag_CannotBeMuted) && (m_id == 0x08))
{
Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_HELPTICKS, 30000, 0);
fromPlayer->addCondition(condition);
}
CONDITION_HELPTICKS = Should be last number * 2, which is: 33554432
and will go under exhaust_heal
Thats how it looks in condition.h![]()
Compiler: Default compiler
Building Makefile: "C:\Users\Stefan Brannfjell\Desktop\forgotten sources\project\Makefile.win"
Executing make...
make.exe -f "C:\Users\Stefan Brannfjell\Desktop\forgotten sources\project\Makefile.win" all
g++.exe -c ../chat.cpp -o ../chat.o -I"C:/forgotten/include" -D__USE_MYSQL__ -D__USE_SQLITE__
In file included from ../creature.h:29,
from ../player.h:25,
from ../chat.cpp:24:
../condition.h:64: error: expected `}' before "CONDITION_HELPTICKS"
../condition.h:65: error: invalid conversion from `int' to `ConditionType_t'
../condition.h:65: error: expected `,' or `;' before '}' token
../condition.h:65: error: expected declaration before '}' token
In file included from ../creature.h:29,
from ../player.h:25,
from ../chat.cpp:24:
../condition.h:21:1: unterminated #ifndef
In file included from ../player.h:25,
from ../chat.cpp:24:
../creature.h:21:1: unterminated #ifndef
In file included from ../chat.cpp:24:
../player.h:21:1: unterminated #ifndef
make.exe: *** [../chat.o] Error 1
Execution terminated
CONDITION_EXHAUST_COMBAT = 8388608,
CONDITION_EXHAUST_HEAL = 16777216
CONDITION_HELPTICKS = 33554432