• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Fixed Guild War System for Website [include all]-[will not count frags] (TFS 0.3+)

Status
Not open for further replies.
@up & re-up xD:
Thanks :p


So Lording & richiaddict, maybe you missed something, some step or whatever.

Do it again, step per step and it will work. Or, re-download the server 0.3.4 pl2 (or pl1 for Lording) and change the database.lua file only.

Regards.
 
I will use in pl2 :p and post my result


edit:
Code:
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
[23/05/2009 09:57:36] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/GuildWar.lua)
[23/05/2009 09:57:36] data/talkactions/scripts/GuildWar.lua:20: 'end' expected (to close 'if' at line 12) near '<eof>'
how can i fix it? anyone know?

EDIT!:
all working now :) thanks Xampy, rep+
 
Last edited:
Xampy <3 for relase rly rep++ BUT could you create the guild war so teams got yellow skull on eachother so frags doesn't count?

What I mean is, Guild 1 sees Guild 2 as yellow skulls and Guild 2 sees Guild 1 as yellow skulls.

Yours truly,
Elite Questbane
 
Thanks.
Yes, you requested it me some days ago. Sorry, I forgot it =/
I'll post the script tomorrow.

Regards.
 
i have problem in kill.lua .I want to use the svargrond arena and guild wars but only the arena works. My script:
PHP:
dofile("./GuildWar.lua")

local PZ = createConditionObject(CONDITION_INFIGHT)
setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('pzLocked'))

function onKill(cid, target)
	if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
		local myGuild = getPlayerGuildId(cid)
		local enemyGuild = getPlayerGuildId(target)
		if myGuild ~= 0 and enemyGuild ~= 0 then
			if enemyGuild == getGuildWarInfo(myGuild).With then
				removeFrag(cid)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This Frag will not count") --Remove this if you wish
				doAddCondition(cid, PZ)
				registerDeath(myGuild, enemyGuild, cid, target)
			end
		end
        end
	return TRUE
end

function onKill(cid, target)
	local monster = getCreatureName(target)
	local room = getArenaMonsterIdByName(monster)
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You can enter to next room!')
	end
       return TRUE
end
 
@Tuchol:
I'm not going to repair your bug because Zonet already repaired you. xD

@thread:
Hello!!!
I made a script that will not count any frag if you are killing someone that is versus you in war.

Let's go:

1st -> Remove the old creaturescript file.
2nd -> Remove the line of login.lua from creaturescripts/scripts/ folder that contains:
Lua:
registerCreatureEvent(cid, "PlayerKill")
3rd -> Remove this line from creaturescripts.xml:
Lua:
<event type="kill" name="PlayerKill" event="script" value="kill.lua"/>
Now, we are going to make available the script:
4th -> Fill this into your creaturescripts.xml:
Lua:
	<event type="attack" name="WarAttack" event="script" value="war_attack.lua"/>
	<event type="kill" name="WarKill" event="script" value="war_kill.lua"/>
5th -> Go to the scripts folder (of creaturescripts) and make a file called war_attack.lua, and copy/paste this into it:
Lua:
dofile("./GuildWar.lua")

function onAttack(cid, target)
	if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
		local myGuild = getPlayerGuildId(cid)
		local enemyGuild = getPlayerGuildId(target)
		if myGuild ~= 0 and enemyGuild ~= 0 then
			if enemyGuild == getGuildWarInfo(myGuild).With then
				if getPlayerSkullType(cid) == 3 or getPlayerSkullType(cid) == 4 then
					if getPlayerSkullType(target) == 0 then
						doCreatureSetSkullType(cid, 1)
						doCreatureSetSkullType(target, 1)
					end
				end
			end
		end
        end
	return TRUE
end
6th -> Make another file, into the same folder, with name war_kill.lua, and copy/paste this into it:
Lua:
dofile("./GuildWar.lua")

local PZ = createConditionObject(CONDITION_INFIGHT)
setConditionParam(PZ, CONDITION_PARAM_TICKS, getConfigInfo('whiteSkullTime'))

function onKill(cid, target)
	if isPlayer(cid) == TRUE and isPlayer(target) == TRUE then
		local myGuild = getPlayerGuildId(cid)
		local enemyGuild = getPlayerGuildId(target)
		if myGuild ~= 0 and enemyGuild ~= 0 then
			if enemyGuild == getGuildWarInfo(myGuild).With then
				doAddCondition(cid, PZ)
				registerDeath(myGuild, enemyGuild, cid, target)
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")

			end
		end
        end
	return TRUE
end
7th -> Save and close both files. Open login.lua file, and below registerCreatureEvent(cid, "PlayerDeath"), fill this:
Lua:
	registerCreatureEvent(cid, "WarAttack")
	registerCreatureEvent(cid, "WarKill")


PS You won't see any yellow skull, but the script will think that both have yellow skull.

Enjoy!
 
Last edited:
@up & re-up xD:
Thanks :p


So Lording & richiaddict, maybe you missed something, some step or whatever.

Do it again, step per step and it will work. Or, re-download the server 0.3.4 pl2 (or pl1 for Lording) and change the database.lua file only.

Regards.

o yeah i forgot to mention i get this error every time the globalevent time 1800 passes. and it is every time the globalevent time passes
 
@Elite Questbane:
Hehehe! :p:p

@richiaddict:
Yes, I supposed it. That's why I changed 1800 to 60 (1 minute); I waited 5 minutes and didn't appear nothing in console. So, probably, you missed something. Check the tutorial and do it again.

Regards.
 
Some1 is going to add support for 0.2 tfs versions i mean (luasql) instead of elf db.query system ?? or i have to spend some time to rewrite it ?
 
If 2 sharing a frag it will be counted as 2 frags at the war stats
 
@Pietia:
Maybe I will make it for 0.2 if I have some free time, cos' now I have final exams in my school and I have to study a lot...

@Raggarn:
What do you mean? If a player is killed by the last hit of two people (blahblah was killed by One and Two.) ??? And it count two frags? I will revise the script. Thank for advise.
 
@Pietia:
Maybe I will make it for 0.2 if I have some free time, cos' now I have final exams in my school and I have to study a lot...

@Raggarn:
What do you mean? If a player is killed by the last hit of two people (blahblah was killed by One and Two.) ??? And it count two frags? I will revise the script. Thank for advise.

Great then i will wait for you -boring work for me :D
 
Does this work when using the latest TFS 0.3.4?

When I try invite someone to war I get this console error:
data/lib/database.lua:60: [Result:getDataInt] Result not set!
stack traceback:
[C]: in function 'error'
data/lib/database.lua:60: in function 'getDataInt'
./GuildWar.lua:225: in function 'guildExist'
data/talkactions/scripts/GuildWar.lua:9: in function <data/talkactions/scripts/GuildWar.lua:3>



-edit-
I read the whole thread, I'll try re-do everything. Report back in a min. :)

-Second edit-
Still not working using TFS 0.3.4 PL2

-Third edit-
Seems to work when I'm not on GM. Great thanks =)
 
Last edited:
@Elox & Zonet:

I will test it and repair it on TFS 0.3.4 PL2 and the TFS 0.2.2; I will post the scripts for that versions, if I can, this weekend.

Sorry.
 
@Elox & Zonet:

I will test it and repair it on TFS 0.3.4 PL2 and the TFS 0.2.2; I will post the scripts for that versions, if I can, this weekend.

Sorry.

GOGO hope that u will make it soon :)
 
Status
Not open for further replies.
Back
Top