zakius
Enter the Ninja!
It was requested few times, so I post it
if you have not edited your start.lua replace it with this one
if you edited it, put
in first line of it
and
before return true
and in both cases add in the begining of your config lua
and if you want to send players to temples change updated=false to updatet=true and start server
players will login in hometown temples and script will change updated back to false
EDIt: lol, sth got crazy now, w8 until I'll fix it
ok, fixed
if you have not edited your start.lua replace it with this one
Code:
dofile("config.lua")
function onStartup()
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
if (updated) then
db.executeQuery("UPDATE `players` SET `posx` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE `players` SET `posy` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE `players` SET `posz` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
local f = io.open('config.lua','r')
if f then
local str = f:read(-1)
f:close()
local ae = string.match(str,"updated=true(.+)")
if ae then
file = 'updated=false'..ae
local f = io.open('config.lua','w')
if f then
f:write(file)
f:close()
end
end
end
end
return true
end
if you edited it, put
Code:
dofile("config.lua")
and
Code:
if (updated) then
db.executeQuery("UPDATE `players` SET `posx` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE `players` SET `posy` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE `players` SET `posz` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
local f = io.open('config.lua','r')
if f then
local str = f:read(-1)
f:close()
local ae = string.match(str,"updated=true(.+)")
if ae then
file = 'updated=false'..ae
local f = io.open('config.lua','w')
if f then
f:write(file)
f:close()
end
end
end
end
and in both cases add in the begining of your config lua
Code:
updated=false
and if you want to send players to temples change updated=false to updatet=true and start server
players will login in hometown temples and script will change updated back to false
EDIt: lol, sth got crazy now, w8 until I'll fix it
ok, fixed
Last edited: