I was trying to make a script about if a player for some reason logout or disconnect, when the player logout back in, the character will return to where he disconnected. But only allow once. If logout second time, the character will return to save point.
I am able to do it without count logout time, I was tried many methods, but did not work. I hope someone can teach me how to do it.
Question
Surefirer
Hello,
I was trying to make a script about if a player for some reason logout or disconnect, when the player logout back in, the character will return to where he disconnected. But only allow once. If logout second time, the character will return to save point.
I am able to do it without count logout time, I was tried many methods, but did not work. I hope someone can teach me how to do it.
I script as following:
- script reset_map -1,{
OnInit:
setarray .maplist$[0],"prt_fild08";
end;
OnPCLogoutEvent:
getmapxy (.@map$, .@x, .@y, BL_PC);
if (inarray(.maplist$[0],.@map$) == -1)
end;
warp "prt_fild08",0,0;
end;
}
(I was tired to count the logout times, and use OnPCLogoutEvent to warp character to save point if the character logout the map second with no luck.)
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.