Need help with saving player position when you log out. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with saving player position when you log out. (
/showthread.php?tid=276515)
Need help with saving player position when you log out. -
rangerxxll - 14.08.2011
Hello, what part of my gamemode/FS do i need to edit to save my player position? Also it deletes the cash you get. So for example. If you first start and have 1000 and do a job and make 10000 then log out, it deletes that back to 1000. Thanks for the help guys.
Re: Need help with saving player position when you log out. -
Scenario - 14.08.2011
Use some common sense, it isn't that hard to know what you need to do!
Obtain the information before saving and store the data using the variables you saved the data into.
Re: Need help with saving player position when you log out. -
grand.Theft.Otto - 14.08.2011
Try this:
pawn Код:
// top of script
new LastPos[MAX_PLAYERS];
// onplayerdisconnect
new Float: X, Float: Y, Float: Z;
LastPos[playerid] = GetPlayerPos(playerid, X, Y, Z);
// onplayerspawn
SetPlayerPos(playerid, LastPos[playerid]);
For money:
pawn Код:
// top of script
new LastMoney[MAX_PLAYERS];
// onplayerdisconnect
GetPlayerMoney(playerid, LastMoney[playerid]);
// onplayerspawn
GivePlayerMoney(playerid, LastMoney[playerid]);
Re: Need help with saving player position when you log out. -
rangerxxll - 14.08.2011
Thank you very much my friend.
Re: Need help with saving player position when you log out. -
trickter - 20.12.2011
if i restart the GM the place goes!