• 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!

HELP ME PLEASE ! URGENT !

lSenturion2

Active Member
Joined
Oct 2, 2019
Messages
124
Reaction score
29
242056672_6523430627729092_3738399474238593493_n.jpg
This problem happened yesterday, when implementing a reset system, which replaced all the vocations of all the players to vocation = 0, when I turn on my server the players log in and that message appears on the console, I already looked for the vocation 4294967295, but it does not exist in any table. this causes the memory console to inflate and the game to crash
 
There's no way to know how to fix this issue since you didn't show us the "reset system" you implemented and database is already affected, so it would be your fault as is strongly recommended to backup everything before implemething those type of systems. If you post a link or show us the files you changed maybe you can do something, but I don't think you can revert easily the affected values in db without a backup.
 
Yeah, by using the query all players will have vocation ID 13.

Does vocation ID 13 exists on your server?
 
Yes it does, but the problem still closing the console, i've tried making the vocation 4294967295 but it doesnt works
 

Attachments

  • Screenshot_20210926-135022_Microsoft Remote Desktop.jpg
    Screenshot_20210926-135022_Microsoft Remote Desktop.jpg
    150.9 KB · Views: 14 · VirusTotal
Code:
local config =
{
   levelLimit = 2000, --limit of course
   kickTime = 2000, --(in miliseconds) time before player gets kicked
   removeInventory = false, --remove items from inventory after reset? (to prevent players using items with level required after reset)
   newLevel = 8, --new level after reset
   newExp = 1, --new exp after reset
   resetSkills = true, --reset skills?
   skillLevel = 11, --new skills level after reset
   resetMagic = true, --reset magic level?
   newMagic = 2, --new magic level after reset
   resetHealth = true, --reset health?
   newHealth = 1100, --new player health/healthmax after reset
   resetMana = true, --reset mana?
   newMana = 1100, --new player mana/manamax after reset
   resetVocation = true, --delete promotion?
   resetProfesion = true --delete promotion?
}
 
local displayMessage, message = true, "You have reached the level limit, you will be kicked in " .. config.kickTime / 1000 .. " seconds."
 
function onAdvance(cid, skill, oldlevel, newLevel)
 
   if(skill == SKILL__LEVEL and isPlayer(cid)) then
      if newLevel >= config.levelLimit then
         local queries = {}
         local id = getPlayerGUID(cid)   
 
         if displayMessage then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, message)
            doTeleportThing(cid, {x = 19114, y = 19200, z = 7})
         end
         if config.removeInventory then
            table.insert(queries, "delete from player_items where player_id = " .. id .. ";")
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Save your items on the depot or will be deleted after the reset.")
         end
         if config.resetSkills then
            for i = 1, 6 do
               table.insert(queries, "update player_skills set value = " .. config.skillLevel .. ", count = 0 where skillid = " .. i - 1 .. " and player_id = " .. id .. ";")
            end
         end
         doPlayerAddItem(cid, 18093, 1)
         setPlayerReborn(cid,getPlayerReborn(cid)+1)
         table.insert(queries, "update players set level = " .. config.newLevel .. ", experience = " .. config.newExp .. "" .. (config.resetMagic and ", maglevel = " .. config.newMagic .. "" or "") .. (config.resetHealth and ", health = " .. config.newHealth .. ", healthmax = " .. config.newHealth .. "" or "") .. (config.resetMana and ", mana = " .. config.newMana .. ", manamax = " .. config.newMana .. "" or "") .. (config.resetVocation and ", promotion = 0" or "") .. (config.resetProfesion and ", vocation = 0" or "") .. ";")
         addEvent(reset, config.kickTime, getCreatureName(cid), queries)
      else
         if config.levelLimit - newLevel <= 10 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. config.levelLimit - newLevel .. " levels more to reach the limit".. (config.removeInventory and ", remember to save your items at the depot" or "") .. ".")
         end
      end
   end
   return true
end
 
function reset(p, queries)
   if getPlayerByName(p) ~= nil then
      doRemoveCreature(getCreatureByName(p))
      db.executeQuery("update players set online = 0 where id = " .. getPlayerGUIDByName(p) .. ";")
   end
   for i = 1, table.maxn(queries) do
      if not db.executeQuery(queries[i]) then
         print("[RESET] Unable to execute query: " .. queries[i])
      end
   end
   return true
end
 
It's missing "where" clause in your Sql statement

table.insert(queries, "update players set level = " .. config.newLevel .. ", experience = " .. config.newExp .. "" .. (config.resetMagic and ", maglevel = " .. config.newMagic .. "" or "") .. (config.resetHealth and ", health = " .. config.newHealth .. ", healthmax = " .. config.newHealth .. "" or "") .. (config.resetMana and ", mana = " .. config.newMana .. ", manamax = " .. config.newMana .. "" or "") .. (config.resetVocation and ", promotion = 0" or "") .. (config.resetProfesion and ", vocation = 0" or "") .. ";")

Add this before ";"

where player_id = " .. id ..


Because of that, when someone reset, everyone offline in the server is being reseted.

By the way, the script is setting vocation = 0.. Do you have this vocation ID in your vocations.xml?
 
Please read the support board rules. As your post breaks multiple of them.

 
Back
Top