• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

onLogout reset frags [help please]

LUA:
function onLogout(cid)
     if isPlayer(cid) then
          db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
     end
     return true
end
 
i made this a lua and its not working.
is this used correctly?
<event type="logout" name="fragreset" event="script" value="fragreset.lua"/>
 
i would say its better to make it onLogin just for making the insertion easier.
function onLogin(cid)
if isPlayer(cid) then
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
end
return true
end

Insert it into OnLogin.lua

Tested on 0.3.7 9.81 and working
 
Back
Top