[HELP] Saving player pos
#1

Hey, I'm back again..
SA-MP scripting is like a drug

I'm tryin' to save the player pos on logout so OnPlayerDisconnect I have a "SavePlayerStats".
Offcourse..

and here's the problem I have:

pawn Код:
public SavePlayerStats(playerid)
{
    GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
    dUserSetINT(PlayerName(playerid)).("x", PlayerInfo[playerid][pPosX]);
    dUserSetINT(PlayerName(playerid)).("y", PlayerInfo[playerid][pPosY]);
    dUserSetINT(PlayerName(playerid)).("z", PlayerInfo[playerid][pPosZ]);
    return 1;
}
When I compile I get "Tag Mismatch" on the last three lines...
Can someone tell me whats wrong please ?

Don't You dare tell me to search I know how to do and I couldn't find anything
Reply
#2

Are PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY] and PlayerInfo[playerid][pPosZ] defined as floats?

Like:
pawn Код:
enum pInfo
{
  Float:pPosX,
  Float:pPosY,
  Float:pPosZ
};
You probably forgot the Float: tag.

EDIT: Here's another reason for the warning:
You're using dUserSetINT which is only for INTEGERS. Use dUserSetFLOAT for FLOAT numbers.
Reply
#3

Okay, Yeah, I remembered the Float: before pPosX,Y,Z..

Quote:

You're using dUserSetINT which is only for INTEGERS. Use dUserSetFLOAT for FLOAT numbers.

Fixed it, Thanks : )) <3
Reply
#4

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)