02.09.2010, 00:28
I have this to save:
And this is when it loads ( OnPlayerSpawn ):
The problem is that it does not set the player's Interior correctly.
pawn Код:
new Float:X, Float:Y, Float:Z, Float:A, IntID, World;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
IntID = GetPlayerInterior(playerid);
World = GetPlayerVirtualWorld(playerid);
format(Msg, sizeof(Msg), "You Have Set A New Spawn Location. ** X: (%0.2f) Y: (%0.2f) Z: (%0.2f) Angle: (%.2f) Interior: (%d) World: (%d)**",X, Y, Z, A, IntID, World);
SendClientMessage(playerid, COLOR_LIGHTBLUE, Msg);
dUserSetFLOAT ( PlayerName2( playerid ) ).( "SpawnX", floatround( X ) );
dUserSetFLOAT ( PlayerName2( playerid ) ).( "SpawnY", floatround( Y ) );
dUserSetFLOAT ( PlayerName2( playerid ) ).( "SpawnZ", floatround( Z ) );
dUserSetFLOAT ( PlayerName2( playerid ) ).( "SpawnAngle", floatround( A ) );
dUserSetINT ( PlayerName2( playerid ) ).( "SpawnInterior", IntID );
dUserSetINT ( PlayerName2( playerid ) ).( "SpawnWorld", World );
pawn Код:
SetPlayerPos (playerid, dUserINT(PlayerName2(playerid)).("SpawnX"), dUserINT(PlayerName2(playerid)).("SpawnY"), dUserINT(PlayerName2(playerid)).("SpawnZ"));
SetPlayerInterior (playerid, dUserINT(PlayerName2(playerid)).("SpawnInterior"));
SetPlayerVirtualWorld (playerid, dUserINT(PlayerName2(playerid)).("SpawnWorld"));
SetPlayerFacingAngle (playerid, dUserINT(PlayerName2(playerid)).("SpawnAngle"));