hallabackkid101
New Member
Can anyone figure this out?
[02/12/2013 19:58:03] [Error - CreatureScript Interface]
[02/12/2013 19:58:03] data/creaturescripts/scripts/war/login.luanLogin
[02/12/2013 19:58:03] Description:
[02/12/2013 19:58:03] data/creaturescripts/scripts/war/login.lua:14: attempt to call global 'getFrags' (a nil value)
[02/12/2013 19:58:03] stack traceback:
[02/12/2013 19:58:03] data/creaturescripts/scripts/war/login.lua:14: in function <data/creaturescripts/scripts/war/login.lua:1>
[02/12/2013 19:58:03] [Error - CreatureScript Interface]
[02/12/2013 19:58:03] data/creaturescripts/scripts/war/logout.luanLogout
[02/12/2013 19:58:03] Description:
[02/12/2013 19:58:04] data/creaturescripts/scripts/war/logout.lua:3: attempt to call global 'setTmpDeaths' (a nil value)
[02/12/2013 19:58:04] stack traceback:
[02/12/2013 19:58:04] data/creaturescripts/scripts/war/logout.lua:3: in function <data/creaturescripts/scripts/war/logout.lua:1>
function onLogin(cid)
doCreatureSetSkullType(cid, SKULL_NONE)
timeOnline[getPlayerGUID(cid)] = os.time()
resetTimeAlive(cid)
resetDamageCounter(cid)
recalculateHPandMana(cid)
if(isBot(cid)) then
doTeleportThing(cid, getTownTemplePosition(math.random(1, 6)))
else
doTeleportThing(cid, getTownTemplePosition(math.random(1, 13)))
end
registerCreatureEvent(cid, "WarPrepareDeath")
registerCreatureEvent(cid, "WarStatsChange")
db.executeQuery("UPDATE `players` SET `kills` = " .. getFrags(cid) .. ", `tmp_kills` = 0, `deaths` = " .. getDeaths(cid) .. ", `tmp_deaths` = 0, `assists` = " .. getAssists(cid) .. ", `tmp_assists` = 0, `online` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
return true
end
function onLogout(cid)
war_saveTimeAliveRecord(cid)
setTmpDeaths(cid, 0)
setTmpAssists(cid, 0)
setTmpFrags(cid, 0)
setLastAssists(cid, 0)
setLastFrags(cid, 0)
resetTimeAlive(cid)
resetDamageCounter(cid)
db.executeQuery("UPDATE `players` SET `kills` = " .. getFrags(cid) .. ", `tmp_kills` = 0, `deaths` = " .. getDeaths(cid) .. ", `tmp_deaths` = 0, `assists` = " .. getAssists(cid) .. ", `tmp_assists` = 0, `online` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
if(timeOnline[getPlayerGUID(cid)] ~= nil) then
local playerTimeOnline = os.time() - timeOnline[getPlayerGUID(cid)]
if(playerTimeOnline > 10) then
db.executeQuery("INSERT INTO `zotsme_logins` (`id`, `player_id`, `login_time`, `logout_time`, `online_time`, `kills`, `deaths`, `assists`) VALUES (NULL, " .. getPlayerGUID(cid) .. ", " .. timeOnline[getPlayerGUID(cid)] .. ", " .. os.time() .. ", " .. playerTimeOnline .. ", " .. getTmpFrags(cid) .. ", " .. getTmpDeaths(cid) .. ", " .. getTmpAssists(cid) .. ");")
end
end
return true
end
Last edited: