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

Compiling Creature script onGainExp

it also returns no execution on console if u checks it..
[cpp]bool Player::gainExperience(double& gainExp, Creature* target)
{
if(!rateExperience(gainExp, target))
return false;

if(gainExp >= 1)
{
bool deny = false;
CreatureEventList gainExpEvents = target->getCreatureEvents(CREATURE_EVENT_GAINEXP);
for(CreatureEventList::iterator it = gainExpEvents.begin(); it != gainExpEvents.end(); ++it)
{
if(!(*it)->executeGainExp(this, gainExp))
deny = true;
std::cout << "It works!" << std::endl;

}
if(deny)
return false;

addExperience((uint64_t)gainExp);
}
//{ std::cout << "It works!" << std::endl; if(gainExp >= 1)}
}[/cpp]

and the execution don't print any..
Lua:
func. ongainexp(..)
print('..')
end
 
Back
Top