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

Solved How to make this sql query..

Xeo

Zote
Joined
Jun 14, 2009
Messages
129
Solutions
1
Reaction score
2
Location
Chile
EDIT : How to update all players position for those who are 8+ only
 
Last edited:
In creaturescripts.xml add
Code:
	<event type="advance" name="Levelpos" event="script" value="Levelpos.lua"/>
In login.lua add
Code:
	registerCreatureEvent(cid, "Levelpos")
In creaturescripts/scripts save this file
Levelpos.lua
Lua:
--Script by Sonical
local config ={
	level = 8 --Edit how much level
        storage = 22852
}
function onAdvance(cid, skill, oldLevel, newLevel)
queststatus = getPlayerStorageValue(cid,config.storage)
if getPlayerLevel(cid) > config.level and queststatus = -1 then
	db.executeQuery("UPDATE players SET posx = 1025, posy = 1028, posz = 7 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
return true
end
 
PHP:
UPDATE `players` SET `posx` = 1025, `posy` = 1028, `posz` = 7 WHERE `level` < 8;
 
My script didn't owrked or what? Errors?

Maybe I understood your request wrong, lawl
Code:
UPDATE `players` SET `posx` = 1025, `posy` = 1028, `posz` = 7 WHERE `level` > 8;
 
EDIT : How to update all players position for those who are 8+ only

>=8
PHP:
UPDATE `players` SET `posx` = 1025, `posy` = 1028, `posz` = 7 WHERE `level` >= 8;

>8
PHP:
UPDATE `players` SET `posx` = 1025, `posy` = 1028, `posz` = 7 WHERE `level` > 8;
 
Back
Top