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

Save the players position and then call it again from a creaturescript

WarOfTheTitans

Active Member
Joined
Feb 3, 2012
Messages
430
Reaction score
37
I want to know how to save the players position, so I can call the players old position again from a creaturescript. So for example If a player are using an item. The action script will check the players position and save it. Then I want to be able to call it from another script for example a "onLogin" script in creaturescripts.

Ex. On login teleport to the saved position-

thanks :)
 
Depending on the situation.

If this quiery will only for one player per "loop queue", that i'm sure that you ou will NOT feel this.
 
Then, its useless. I found a solution about how to do this. I want to set players master position but it don't work ;/ using 0.3.6

Edit: Solved because I used TGYoshi's way to complete my script.
 
Last edited:
Look.

If you do it only in LUA, then you have to make queries to database everytime when you want to get posiotion of player.

And your question is: "do these quieris will lag my ot?

Answer is: show me and describe your script, becouse its depending on the situation like i said before.
 
Edited: I didn't read 100%. I am doing like this:
Lua:
	local Xstor = 117
	local Ystor = 118
	local Zstor = 119
        local CP = getCreaturePosition(cid)
	setPlayerStorageValue(cid, Xstor, CP.x)
	setPlayerStorageValue(cid, Ystor, CP.y)
	setPlayerStorageValue(cid, Zstor, CP.z)
 
I know how it works.

I mean , how do you use this script

For example,
if player enters the "magic field", then script execute only just for him.
That it will NOT lag your server.

But if scrypt will execute for lot of player at once like 50, 100 or more (depending on the power of a dedicated server and depending on the implementation of functions in a single "queue main game loop), then it will lags.

If you want to do it at once to more players then better way will be make special varaibles in sourcecode [Player.h]....
 
Okay, the thing is that this script can be used by many players at the same time. Only god knows if hundreds are preparing to this at the same time. I hope not ;/
 
Back
Top