• 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.
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/WarKill.lua)
data/creaturescripts/scripts/WarKill.lua:54: 'end' expected (to close 'function' at line 4) near '<eof>'



Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua:eek:nLogin

data/creaturescripts/scripts/login.lua:26: attempt to call global 'RegisterCreatureEvent' (a nil value)
stack traceback:
data/creaturescripts/scripts/login.lua:26: in function <data/creaturescripts/scripts/login.lua:6>


EDIT: capital letter caused it xD.. fixed.. thanks
Repaired, I forgot to close the local function :$.

[17/12/2009 13:02:09] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/WarKill.lua)
[17/12/2009 13:02:09] data/creaturescripts/scripts/WarKill.lua:54: 'end' expected (to close 'function' at line 4) near '<eof>'
Repaired***.
Thanks!
Now works fine!
Thank ya!
 
Wei mira estos errores =S WTF

102lfdw.jpg


281c4g1.jpg


33wm59y.jpg
 
@bolero:

Test the new script (WarKill.lua // creaturescript):
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 GUID = getPlayerGUID(cid)
        local NAME = getPlayerName(cid)
        local namet = getPlayerName(target)
        local skull = getCreatureSkullType(cid)
        local fragTime = getConfigInfo('timeToDecreaseFrags')
        local amount = getPlayerRedSkullTicks(cid)
        local frags = math.floor((amount / fragTime) + 1)
        local cidd = cid

local function removeFrag(cid)

        local amountt = getPlayerRedSkullTicks(cidd)
        local fragss = math.floor((amountt / fragTime) + 1)

if fragss > frags then
        doPlayerSetRedSkullTicks(cidd, amount)
        doPlayerSendTextMessage(cidd, 21, "Frag from "..namet.." wasn't counted.")
end

if skull == SKULL_WHITE then
        if getCreatureSkullType(cidd) == SKULL_RED then
                doCreatureSetSkullType(cidd, SKULL_WHITE)
                doPlayerSetRedSkullTicks(cidd, 0)
        end
end
end

                local myGuild = getPlayerGuildId(cid)
                local enemyGuild = getPlayerGuildId(target)

                if myGuild ~= 0 and enemyGuild ~= 0 then
                        if enemyGuild == getGuildWarInfo(myGuild).With then
                                doAddCondition(cid, PZ)
                                        if getShowInfo(myGuild).S == 1 then
                                                registerDeathOne(myGuild, enemyGuild, cid, target)
                                        else
                                                registerDeathTwo(myGuild, enemyGuild, cid, target)
                                        end    
                                addEvent(removeFrag, 150)
                        end
                end
        end
        return TRUE
end
 
Last edited:
Ok ahora si sirve. El problema es que... EL player de la otra guild me mata no le cuentan el frag pero en la pagina no sale la frag q me mato =S! No entiendo.... Se supone que tiene que contar cada vez que me mate pero el marcador esta 0 - 0
 
Sale algun error en la consola etc? // Voy a probarlo en 0.3.4, espera.
 
version mod, may be even better, if use function and war system in one files. this link is helpful you understand me.
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Guild War System" version="1.0" author="Xampy and Nahruto" contact="otland.net" enabled="yes">
<config name="function_config"><![CDATA[
... <!--file function.lua-->
]]></config>
<talkaction words="/war-invite; /war-accept; /war-reject; /war-cancel-invite; /war-cancel" event="script"><![CDATA[
domodlib('function_config')
...]]></talkaction>
<globalevent name="wars" interval="1800" event="script"><![CDATA[
domodlib('function_config')
...]]></globalevent>
<event type="login" name="WarLogin" event="script"><![CDATA[
domodlib('function_config')
...]]></event>
<event type="kill" name="WarKill" event="script"><![CDATA[
domodlib('function_config')
...]]></event>
</mod>
and fix this
PHP:
    case "buypoints"; 
        $subtopic = "buypoints"; 
        $topic = Buy Points"; /*this wrong $topic = "Buy Points";*/
        include("buypoints.php"); 
    break;
 
Last edited:
@bolero:
Fixed, sorry for delay.
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 GUID = getPlayerGUID(cid)
	local NAME = getPlayerName(cid)
	local namet = getPlayerName(target)
	local skull = getCreatureSkullType(cid)
	local fragTime = getConfigInfo('timeToDecreaseFrags')
	local amount = getPlayerRedSkullTicks(cid)
	local frags = math.floor((amount / fragTime) + 1)
	local cidd = cid

local function removeFrag(cid)

	local amountt = getPlayerRedSkullTicks(cidd)
	local fragss = math.floor((amountt / fragTime) + 1)

if fragss > frags then
	doPlayerSetRedSkullTicks(cidd, amount)
	doPlayerSendTextMessage(cidd, 21, "Frag from "..namet.." wasn't counted.")
end

if skull == SKULL_WHITE then
	if getCreatureSkullType(cidd) == SKULL_RED then
		doCreatureSetSkullType(cidd, SKULL_WHITE)
		doPlayerSetRedSkullTicks(cidd, 0)
	end
end
end

                local myGuild = getPlayerGuildId(cid)
                local enemyGuild = getPlayerGuildId(target)

                if myGuild ~= 0 and enemyGuild ~= 0 then
                        if enemyGuild == getGuildWarInfo(myGuild).With then
                                doAddCondition(cid, PZ)
					if getShowInfo(myGuild).S == 1 then
		                                registerDeathOne(myGuild, enemyGuild, cid, target)
					else
						registerDeathTwo(myGuild, enemyGuild, cid, target)
					end	
				addEvent(removeFrag, 150)
                        end
                end
        end
        return TRUE
end

@redbull915:
I'm going to check if it works, thank ya.
 
I have 1 problem! I'm using 0.3.5
When i kill 1 player... it count 2 frags!

24 Oct 2009, 13:31 Killed at Level 52 by Alex Moraes, Alex Moraes and Alex Moraes.
HOW?

How can i fix it?
 
Last edited:
i use 0.3.5pl1 with newest guild war system - when i'm not in guild and i type /war-invite "name_of_guild" i got in the cosnole error:

Code:
Lua Script Error: [TalkAction Interface]
buffer:onSay

[string "loadBuffer"]:91: attempt to index local 'file' (a nil value)
stack traceback:
        [string "loadBuffer"]:91: in function <[string "loadBuffer"]:2>

this is normal??
 
Well i have done everything but there is no tab to click on for wars
 
I'm getting this error, when i try to kill someone they go to 0 hp but don't die

Code:
[18/12/2009 17:56:55] [Error - CreatureScript Interface] 
[18/12/2009 17:56:55] data/creaturescripts/scripts/WarKill.lua:onKill
[18/12/2009 17:56:55] Description: 
[18/12/2009 17:56:55] data/creaturescripts/scripts/WarKill.lua:13: attempt to call global 'getPlayerRedSkullTicks' (a nil value)
[18/12/2009 17:56:55] stack traceback:
[18/12/2009 17:56:55] 	data/creaturescripts/scripts/WarKill.lua:13: in function <data/creaturescripts/scripts/WarKill.lua:4>
 
Status
Not open for further replies.
Back
Top