18.11.2010, 00:49
Quote:
btw, 'new I;' will be set to 0!
pawn Код:
|
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;
}
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;
}