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

Reset level

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hello,
i looking for script to reset all players lvl to 100 (hp/mp/cap etc back too).

Someone can help? :}
 
LUA:
local totalCapacity = 237 -- ???
function onSay(cid, words, param, channel)
     db.executeQuery("UPDATE `players` SET `level`= 100;")
     db.executeQuery("UPDATE `players` SET `health`= 1;")
     db.executeQuery("UPDATE `players` SET `mana`= 1;")
     db.executeQuery("UPDATE `players` SET `cap`= "..  totalCapacity ..";")
     return 0
end

This should work.
 
Test this one:
LUA:
local totalCapacity = 237 -- ???
local world_id = 1
function onSay(cid, words, param, channel)
     db.executeQuery("UPDATE `players` WHERE `world_id` = ".. world_id .." SET `level`= 100;")
     db.executeQuery("UPDATE `players` WHERE `world_id` = ".. world_id .." SET `health`= 1;")
     db.executeQuery("UPDATE `players` WHERE `world_id` = ".. world_id .." SET `mana`= 1;")
     db.executeQuery("UPDATE `players` WHERE `world_id` = ".. world_id .." SET `cap`= "..  totalCapacity ..";")
     return 0
end
 
Not working :(

when i set this on db
UPDATE `players` WHERE `world_id` =1 SET `level` =100

error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `world_id` = 1 SET `level`= 100' at line 1

Can you do, delete all players with world = 1 without players with account_id = 1
 
How will it reset level? In-game?

What do you want? Talkaction? Globalevent?


Code:
UPDATE players WHERE world_id = 1 SET level= 100;
also you can do that
LUA:
function onLogin(cid)
		if isPlayer(cid)
				local setPlayerLevelOnLogin = 100
				doPlayerAddExperience(cid, (getExperienceForLevel(setPlayerLevelOnLogin) - getPlayerExperience(cid)))
		end
	return TRUE
end
 
Last edited:
When player login he will get lv150
LUA:
function onLogin(cid)
		if isPlayer(cid)
				local setPlayerLevelOnLogin = 100
				doPlayerAddExperience(cid, (getExperienceForLevel(setPlayerLevelOnLogin) - getPlayerExperience(cid)))
		end
	return TRUE
end
 
Not working,
set 100lv, but then hp is bugged :(


Someone can tell me, how can i delete all players with world_id = 1, without players with account_id = 1?

Please fast :(
 
Last edited:
Back
Top