ID:162706
 
Ok, I'm trying to save the location of the players where they logged out at, I use names to locate places ie Move(locate(/area/temple)) how would I save their last location before logout, I know use a var, but what would I save?
Lundex wrote:
Ok, I'm trying to save the location of the players where they logged out at, I use names to locate places ie Move(locate(/area/temple)) how would I save their last location before logout, I know use a var, but what would I save?

lol here,
mob/var/lastx
mob/var/lasty
mob/var/lastz
var/players=new/list()

client/proc/SaveMob()
usr.lastx=usr.x
usr.lasty=usr.y
usr.lastz=usr.z
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"]<<src.mob
sleep(1)
src<<"Save Complete!"
In response to Scarymonkeys623
Only one problem, Its a MUD, you know text based. It doesn't have x y and z coords...I'm trying to save it based on the tags
In response to Lundex
Lundex wrote:
Only one problem, Its a MUD, you know text based. It doesn't have x y and z coords...I'm trying to save it based on the tags

oops well im not sure if it will work but heres a idea , it probally wont but heres a idea:

mob/var/lastarea
var/players=new/list()

client/proc/SaveMob()
usr.lastarea=usr.area

sry but im not good t MUD's
In response to Scarymonkeys623
I'm trying to think that maybe I can set it by name or make a var and give each area a number which could do it...but I'll have to check it out....
In response to Lundex
Lundex wrote:
I'm trying to think that maybe I can set it by name or make a var and give each area a number which could do it...but I'll have to check it out....

see im not good with area's i'm a iconned cord man, area's to me are kinda hard, the only areas i can do are safe zones and non safe zones
In response to Scarymonkeys623
Hmm, understandable I'm just hoping someone who is good with MUDs will show up..
In response to Lundex
im not sure if this will work but its a pretty good guess it you ask me,
mob/var
area

area
Blah
Enter()
usr.area=Blah
Login
if(usr.area==Blah)
//i dont know wat to put here cause im not good
//muds as i said but tele him like that
//sorry about it but thats as good as i know but
//it probally will get annoying adding all those
//areas.

-Tony
In response to Scarymonkeys623
Hmm, thanks for the try...
In response to Lundex
Don't put usr in procs, it can cause problem later.

But he was on the right track. You can save the players location using a variable, and check for that variable at Login(). Doesn't require x,y,z.
In response to Pyro_dragons
Think you show me an example?
In response to Lundex
He already did. I was just explaining what he showed in a little more detail.

Create a variable that you will save the location they are "at" to the player. Later, when they log back in, access this variable and ,based on its value, go from there.
In response to Pyro_dragons
Ok, but when I used Enter() it disable the movement for the character..
In response to Lundex
Because he is using Enter() incorrectly. Look it up in the help ref.
In response to Pyro_dragons
Finally got it to work, thanks both of ya...:D