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

Change the code? :)

ScorpiOOn93

etherno.net
Joined
Jun 19, 2008
Messages
662
Reaction score
1
Location
CookieLand :DDD
Hello

I have a quesiton.
Would someone change my code from TFS 0.2 to 0.3 ?
It's a anty guild member attack that it's working on tfs 0.2 but i need this on 0.3

I will send you this code on PM if you want to help me.
 
Hello

I have a quesiton.
Would someone change my code from TFS 0.2 to 0.3 ?
It's a anty guild member attack that it's working on tfs 0.2 but i need this on 0.3

I will send you this code on PM if you want to help me.

i can take a look at it, is it source or lua?
 
Code:
function onAttack(cid, target)
	if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
		if getConfigInfo("noDamageToGuildMembers") == "yes" then
			if getPlayerGuildId(cid) == getPlayerGuildId(target) then
				doPlayerSendCancel(cid, RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER)
				return FALSE
			end
		end
	end
	return TRUE
end

Add to config.lua "noDamageToGuildMembers = "yes"", register the event in .xml file and try.
 
Works perfectly for me just add the !

Code:
	if(!g_config.getBool(ConfigManager::GUILD_MEMBER_ATTACK))       
		if(attacker->getGuildId() == target->getGuildId())
			return true;
 
Last edited:
@Up
Omg...
I have guildmemberattack = "no"
But i just write it without " -.-
It's not working, i'm not a noob then it will be nice if you will stop treat me like a noob, tnx...

I will try with script by Rudolf... i hope it will work
 
@Up
Omg...
I have guildmemberattack = "no"
But i just write it without " -.-
It's not working, i'm not a noob then it will be nice if you will stop treat me like a noob, tnx...

I will try with script by Rudolf... i hope it will work

you sure do act like one tho lol :), sorry you can't make a simple script work ;)
 
@Up
O Rly? pfff

It's not working.

1) First script that you gave my wasn't working (all players can attack eachother)
if(if(g_config.getBool(ConfigManager::GUILD_MEMBER_ATTACK))
if(attacker->getGuildId() == target->getGuildId())
{
if(attacker->getGuildId() == 0 && target->getGuildId() == 0) {
return false;
}
return true;
}

2) Second script that you gave me wasn't working properly (Players in this same guild can't attack another players in this same guild but they can attack players without guild (or in another guild) and it's ok, but players without guild can't attack another players without guild o_O)
if(!g_config.getBool(ConfigManager::GUILD_MEMBER_ATTACK))
if(attacker->getGuildId() == target->getGuildId())
return true;

I think you even didn't tested it :>
But anyway tnx for trying to help me.
 
its whatever, it worked for me (yes i did actually edit my source, compile, and test) anyways..hopefully you get something working, and for future reference if something isn't working the way you want it, let the person helping you know exactly what its not doing for you instead of just saying it does not work
 
Back
Top