kito2
www.masteria.net
Thanks!
Now works fine!
Now works fine!
Repaired, I forgot to close the local function :$.[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.luanLogin
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***.[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>'
Thank ya!Thanks!
Now works fine!
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
<?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>
case "buypoints";
$subtopic = "buypoints";
$topic = Buy Points"; /*this wrong $topic = "Buy Points";*/
include("buypoints.php");
break;
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
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>
[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>