• 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.
Thanks for be patient :D!



Use the new war_kill.lua file posted in main thread.:peace:
Lua:
dofile("./GuildWar.lua")

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

function onKill(cid, target, lastHit)
        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)
                                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")
                                if lastHit == TRUE then
                                        registerDeath(myGuild, enemyGuild, cid, target)
                                end
                        end
                end
        end
        return TRUE
end

I'll check it tomorrow.:$

I'm using the "All-In-One-Package" But I've added the script that was trying to fix the problem but it didnt help.. :huh:
 
Mans, please help me. War system dont charge frags when war start.

War stated at: 18:04, and player from one guild has killed by a player from other guild which is war. And system dont charge frag.
Why? Help me please.

Look: Restia - Wars
Player died at 5 Nov 2009, 18:47 but war start at 18:04 well? ;(
 
I don't have so much free time to fix things.

All the people who has problems about counting frags/not counting frags/etc, must use the war_kill.lua file that is on main post from this thread.

@Master-m:

Before (war_kill.lua):
Code:
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)
                                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")
                                registerDeath(myGuild, enemyGuild, cid, target)
                        end
                end
        end
        return TRUE
end

Now (war_kill.lua):
Code:
dofile("./GuildWar.lua")

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

function onKill(cid, target[COLOR="Red"], lastHit[/COLOR])
        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)
                                doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "This frag will not count!")
                                [COLOR="Red"]if lastHit == TRUE then
                                        registerDeath(myGuild, enemyGuild, cid, target)
                                end[/COLOR]
                        end
                end
        end
        return TRUE
end
 
I dont understand how its work ??
Player say /war-invite NAMEGUILD
Player other guild say /war-accept
and now what must says ??
 
@piti129:
Yes. And then, on website will appear, on wars subtopic, the guilds in war.
 
OK it works add frags to website.
When say :
/war-accept
nothing happens and should probably teleport to maps1 or maps2
I have bug when you kill someone not a guild wars you dont get frags??
 
When I click on "Kills" [0-0]
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in C:\xampp\htdocs\pot\OTS_Player.php:265 Stack trace: #0 C:\xampp\htdocs\wars.php(370): OTS_Player->getName() #1 C:\xampp\htdocs\index.php(227): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\pot\OTS_Player.php on line 265
 
I have this Error:
[08/11/2009 13:26:12] Lua Script Error: [TalkAction Interface]
[08/11/2009 13:26:12] data/talkactions/scripts/GuildWar.lua:eek:nSay

[08/11/2009 13:26:12] data/lib/database.lua:60: [Result:getDataInt] Result not set!
[08/11/2009 13:26:12] stack traceback:
[08/11/2009 13:26:12] [C]: in function 'error'
[08/11/2009 13:26:12] data/lib/database.lua:60: in function 'getDataInt'
[08/11/2009 13:26:12] ./GuildWar.lua:225: in function 'guildExist'
[08/11/2009 13:26:12] data/talkactions/scripts/GuildWar.lua:8: in function <data/talkactions/scripts/GuildWar.lua:2>

Please Help Me :(
 
Why, when I click at Guild War in Guild Name get the error:
The Following Errors Have Occurred:
# Guild with ID 0 doesn't exist.
 
On TFS 0.3.4PL2 people loosing red skulls ;/ How to fix that? ;/
 
Please Help me !

[C]: in function 'error'
[11/11/2009 00:44:25] data/lib/database.lua:60: in function 'getDataInt'
[11/11/2009 00:44:25] ./GuildWar.lua:194: in function 'getGuildsWithWar'
[11/11/2009 00:44:25] data/globalevents/scripts/wars.lua:4: in function <data/globalevents/scripts/wars.lua:3>
[11/11/2009 00:44:25] [Error - GlobalEvents::think] Couldn't execute event: wars


wars.lua in globalevents

dofile("./GuildWar.lua")

function onThink(interval, lastExecution)
for _, id in ipairs(getGuildsWithWar()) do
local Check = db.getResult("SELECT `name` FROM `guilds` WHERE id = ".. getGuildWarInfo(id).With .."")
if Check:getID() == LUA_ERROR then
cleanInfo(id)
end
end
return TRUE
end

ThX
 
did anyone using 0.3.4pl2 distro made it work already?...
everything seems to be working for me but when 2 guilds start a war... the kills for each guild are not counted, and when i click at the guilds in war i get: The Following Errors Have Occurred:
# Guild with ID 0 doesn't exist.
ANYONE FOR GodSake? xD
 
Status
Not open for further replies.
Back
Top