Bump
<event type="kill" name="no-exp" event="script" value="enforced.lua"/>
function remove_exp(cid, old)
if isPlayer(cid) then
doPlayerAddExperience(cid, - (getPlayerExperience(cid) - old))
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'Exp from MC not allowed!')
end
end
function onKill(cid, target, flags)
if not isPlayer(target) then
return true
end
if (getPlayerIp(cid) == getPlayerIp(target)) then
if(flags % 2 == 1) then
addEvent(remove_exp, 100, cid, getPlayerExperience(cid))
end
end
return true
end
I do not understan one thing.Just remove the exp from same IP. This can be done via source:
http://otland.net/threads/no-exp-fr...g-another-player-pvp-enforced-hardcore.74764/
double Player::getGainedExperience(Creature* attacker) const
Player* attackerPlayer = attacker->getPlayer();
if(!attackerPlayer || attackerPlayer == this)
return 0;
if(attackerPlayer->getIP() == getIP() && !g_config.getBool(ConfigManager::GAIN_EXP_FROM_SAME_IP))
return 0;
if(!attackerPlayer || attackerPlayer == this)
if(attackerPlayer->getIP() == getIP() && !g_config.getBool(ConfigManager::GAIN_EXP_FROM_SAME_IP))
Thanks but it does not work, it changed nothing :/