Quote:
Originally Posted by [L3th4l]
btw, 'new I;' will be set to 0!
pawn Код:
new I; I = GetPlayerInterior(playerid); // Get the player's interior, and 'hold it' into the 'I' var
|
Thanks i noticed it earlier I was wondering why kept putting 0 lol i changed the save to this
pawn Код:
public SavePlayerPos(playerid)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_SERVERFILES, name);
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
dini_FloatSet(file, "LocX", X);
dini_FloatSet(file, "LocY", Y);
dini_FloatSet(file, "LocZ", Z);
dini_FloatSet(file, "LocA", A);
dini_IntSet(file, "LocI", GetPlayerInterior(playerid));
return 1;
}
I looked off a tutorial to see how too. But still the same so i was like what the hell i put a format message to show me where its spawning me well the response was
Spawning you at your lasted saved position 0.0000 0.0000 0.0000 0.0000 and interior 0.0000 Okay so my code is reading wrong right? cause i coppied my user saved position from userfile to see if they are wrong and that was my results
Here the spawn command
pawn Код:
public SpawnLastSavedPosition(playerid)
{
new string[128], Float:LocX, Float:LocY, Float:LocZ, Float:LocA, INT;
LocX = GetPVarFloat(playerid, "pLocX");
LocY = GetPVarFloat(playerid, "pLocY");
LocZ = GetPVarFloat(playerid, "pLocZ");
LocA = GetPVarFloat(playerid, "pLocA");
INT = GetPVarInt(playerid, "pLocI");
SetPlayerPos(playerid, LocX,LocY,LocZ);
SetPlayerFacingAngle(playerid, LocA);
SetPlayerInterior(playerid, INT);
format(string, sizeof(string), "Spawning you back to your last saved position at %f, %f, %f, %f With Inteior %d.", LocX, LocY, LocZ, LocA, INT);
SendClientMessage(playerid, WHITE, string);
return 1;
}