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

NoDmgToParty or guildmember someone can re edit?

volitar

New Member
Joined
Dec 2, 2008
Messages
61
Reaction score
0
Hello.. as usual i need help with script:p

i found this script but its only working all the time i want it with commands so if not use command they will be dmg..



/data/config.lua
Lua:
noDamageToGuildMates = true -- if true then no damage, if false then damage
noDamageToPartyMembers = true -- if true then no damage, if false then damage

/creaturescripts/scripts/partyAndGuildProtection.lua
Lua:
function onCombat(cid, target)
	if(isPlayer(cid) and isPlayer(target)) then
		if(getConfigValue("noDamageToGuildMates")) then
			if(getPlayerGuildId(cid) == getPlayerGuildId(target)) then
				return false
			end
		end
		if(getConfigValue("noDamageToPartyMembers")) then
			if(getPlayerParty(cid) == getPlayerParty(target)) then
				return false
			end
		end
	end
	return true
end

/creaturescripts/creaturescripts.xml
XML:
<event type="combat" name="partyAndGuildProtection" event="script" value="partyAndGuildProtection.lua"/>

/creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "partyAndGuildProtection")

Simply, when config values are set to true then players with the same guild or in the same party can't deal damage to eachother.


like you can see its not my script just want it re edited..


//Volitar
 
okey.. like im leader in guild and i can say /noattk then noone in the guild can take dmg on each other. and if leader say /attack then guild members can attack each other aigen. and same with party system..


good enof or do i need to say somemore. relly bad on explain :p
 
Lua:
function onCombat(cid, target)
	if(isPlayer(cid) and isPlayer(target)) then
		if(getConfigValue("noDamageToGuildMates")) then
			if(getPlayerGuildId(cid) == getPlayerGuildId(target)) then
				return false
			end
		end
		if(getConfigValue("noDamageToPartyMembers")) then
			if(getPlayerParty(cid) == getPlayerParty(target) and getCreatureStorage(getPartyLeader(cid), 1000) > 0) then
				return false
			end
		end
	end
	return true
end

Lua:
function onSay(cid, words, param, channel)
	if (getPartyLeader(cid) == 0 or getPartyLeader(cid) ~= cid) then
	else if (param == "yes") then
		doCreatureSetStorage(cid, 1000, 1)
	else if (param == "no") then
		doCreatureSetStorage(cid, 1000, -1)
	end
	return true
end
 
cant attack so that far it works. but every time i try attack i got error
and the other cant make it work with command it dont do any thing:/..
 
maybe you need to change the storage ids he used there to any empty storage id u have , try umm 12435 :p just a random number make sure u dont use it so it should be :
Code:
function onCombat(cid, target)
	if(isPlayer(cid) and isPlayer(target)) then
		if(getConfigValue("noDamageToGuildMates")) then
			if(getPlayerGuildId(cid) == getPlayerGuildId(target)) then
				return false
			end
		end
		if(getConfigValue("noDamageToPartyMembers")) then
			if(getPlayerParty(cid) == getPlayerParty(target) and getCreatureStorage(getPartyLeader(cid), 12435) > 0) then
				return false
			end
		end
	end
	return true
end
and
Code:
function onSay(cid, words, param, channel)
	if (getPartyLeader(cid) == 0 or getPartyLeader(cid) ~= cid) then
	else if (param == "yes") then
		doCreatureSetStorage(cid, 12435, 1)
	else if (param == "no") then
		doCreatureSetStorage(cid, 12435, -1)
	end
	return true
end
 
well the script works like it should cus i cant attack guild members and so...

its just the talk action thats dont work..
hope someone can fix it or give me another lua script for talk action
 
Back
Top