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

GlobalEvent [TFS 0.3.5] Update for start.lua

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
Version:
TFS 0.3.5

I think everyone who use account manager knows it, if you change the map, you have to go to the databse and change the account manager's position, it nerves <_<.

To disable this, goto data/globalevents/start.lua and delete all in it.
Then paste this:
Lua:
function onStartup()
	db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
	db.executeQuery("UPDATE `players` SET `posx` = "..getConfigValue('newPlayerSpawnPosX')..", `posy` = "..getConfigValue('newPlayerSpawnPosY')..", `posz` = "..getConfigValue('newPlayerSpawnPosZ').." WHERE `name` = 'Account Manager';")
	return TRUE
end
At now, you don't have to go to the database to change the position, it will take the position fom config.lua:
Lua:
	newPlayerSpawnPosX = 1016
	newPlayerSpawnPosY = 1028
	newPlayerSpawnPosZ = 6

I hope you like it ^_^.

Regards,
Shawak
 
Last edited:
Nice, but instead including config file, you should use getConfigValue('ewPlayerSpawnPosX')
 
LOL, this is insane!

Soon we'll have some LUA based database! :O
It just lags everytime when I used PHPMyAdmin.
 
Thanks alot for posting this, I was going crazy before.. just need to bump this thread so let everybody know.

regards
 
i prefer this script
function onStartup()
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
db.executeQuery("UPDATE players SET posx = 32369, posy = 32241, posz = 7;")
return TRUE
end
 
Back
Top