Need help with saving player position when you log out.
#1

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.
Reply
#2

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.
Reply
#3

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]);
Reply
#4

Thank you very much my friend.
Reply
#5

if i restart the GM the place goes!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)