• 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 You may not attack this player

wdvx

Sniper 7.4 War
Joined
Mar 5, 2013
Messages
263
Reaction score
14
I wonder if someone can help me figuring out why this piece of code makes it impossible to attack any other players, under any circumstances. I even tried removing ALL the storage values and so on ...

In function ReturnValue Combat::canTargetCreature(const Player* player, const Creature* target)

I added this:

Code:
	uint32_t k = 500;
	int32_t v = 1;

	const Player* targetPlayer = target->getPlayer();
	if (player && targetPlayer && 
		player->getStorageValue(k, v) == targetPlayer->getStorageValue(k, v))
	{
		return RET_YOUMAYNOTATTACKTHISPLAYER;
	}

This will make it impossible (even with, or without that particular storage value) to attack other players!
 
Code:
if(player->getStorage("9000",-1))
     return RET_YOUMAYNOTATTACKTHISPLAYER;

you can't attack any player just add this code under
Code:
if(player->hasFlag(PlayerFlag_CannotUseCombat))
     return target->getPlayer() ? RET_YOUMAYNOTATTACKTHISPLAYER : RET_YOUMAYNOTATTACKTHISCREATURE;
 
Back
Top