CMD:spawn(playerid,params[]) { GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] ); GetPlayerFacingAngle( playerid, Angle[ playerid ] ); GetPlayerInterior (playerid); GetPlayerVirtualWorld (playerid); GameTextForPlayer(playerid,"~y~Spawn Point ~n~~g~Saved",2000,3); return 1; }
INI_WriteFloat( ACCOUNT, "PositionX", PosX[ playerid ] ); INI_WriteFloat( ACCOUNT, "PositionY", PosY[ playerid ] ); INI_WriteFloat( ACCOUNT, "PositionZ", PosZ[ playerid ] ); INI_WriteFloat( ACCOUNT, "Angle", Angle[ playerid ] );
public OnPlayerDisconnect(playerid, reason) { GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] ); GetPlayerFacingAngle( playerid, Angle[ playerid ] );
public OnPlayerSpawn(playerid) { if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 ) { SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] ); SetPlayerFacingAngle( playerid, Angle[ playerid ] ); SetPlayerInterior( playerid, Interior[ playerid ] ); SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] ); SetCameraBehindPlayer(playerid); } else { new Random = random(sizeof(RandomSpawns)); SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]); // set the position for those who has not saved } return 1; }
You get the coordinates when the player disconnects but do you save them in the file?
|
PositionX = -2244.840576 PositionY = 2293.785888 PositionZ = 4.969128 Angle = 136.209747
public LoginPlayer(playerid, name[], value[]) { INI_Int("Level", pInfo[playerid][pLevel]); INI_Int("Donator", pInfo[playerid][Donator]); INI_Int("Banned", pInfo[playerid][Banned]); INI_Int("Kills", pInfo[playerid][Kills]); INI_Int("Deaths", pInfo[playerid][Deaths]); INI_Int("Muted", pInfo[playerid][Muted]); INI_Int("Score", pInfo[playerid][Score]); INI_Int("Cash", pInfo[playerid][Cash]); INI_Int("Skin", pInfo[playerid][Skin]); INI_String("LastLoggedIP", pInfo[playerid][IP], 16); INI_Int("TotalSeconds", pInfo[playerid][TotalSecs]); INI_Int("Wep0",pInfo[playerid][pWep0]); INI_Int("Wep1",pInfo[playerid][pWep1]); INI_Int("Wep2",pInfo[playerid][pWep2]); INI_Int("Wep3",pInfo[playerid][pWep3]); INI_Int("Wep4",pInfo[playerid][pWep4]); INI_Int("Wep5",pInfo[playerid][pWep5]); INI_Int("Wep6",pInfo[playerid][pWep6]); INI_Int("Wep7",pInfo[playerid][pWep7]); INI_Int("Wep8",pInfo[playerid][pWep8]); INI_Int("Wep9",pInfo[playerid][pWep9]); INI_Int("Wep10",pInfo[playerid][pWep10]); INI_Int("Wep11",pInfo[playerid][pWep11]); INI_Int("Wep12",pInfo[playerid][pWep12]); INI_Int("Ammo0",pInfo[playerid][pAmmo0]); INI_Int("Ammo1",pInfo[playerid][pAmmo1]); INI_Int("Ammo2",pInfo[playerid][pAmmo2]); INI_Int("Ammo3",pInfo[playerid][pAmmo3]); INI_Int("Ammo4",pInfo[playerid][pAmmo4]); INI_Int("Ammo5",pInfo[playerid][pAmmo5]); INI_Int("Ammo6",pInfo[playerid][pAmmo6]); INI_Int("Ammo7",pInfo[playerid][pAmmo7]); INI_Int("Ammo8",pInfo[playerid][pAmmo8]); INI_Int("Ammo9",pInfo[playerid][pAmmo9]); INI_Int("Ammo10",pInfo[playerid][pAmmo10]); INI_Int("Ammo11",pInfo[playerid][pAmmo11]); INI_Int("Ammo12",pInfo[playerid][pAmmo12]); INI_String("Color",pInfo[playerid][color],11); return 1; }
You get the coordinates when the player disconnects but do you save them in the file?
|
pawn Код:
|
EDIT:
I think I missed something here? Код:
public LoginPlayer(playerid, name[], value[]) { INI_Int("Level", pInfo[playerid][pLevel]); INI_Int("Donator", pInfo[playerid][Donator]); INI_Int("Banned", pInfo[playerid][Banned]); INI_Int("Kills", pInfo[playerid][Kills]); INI_Int("Deaths", pInfo[playerid][Deaths]); INI_Int("Muted", pInfo[playerid][Muted]); INI_Int("Score", pInfo[playerid][Score]); INI_Int("Cash", pInfo[playerid][Cash]); INI_Int("Skin", pInfo[playerid][Skin]); INI_String("LastLoggedIP", pInfo[playerid][IP], 16); INI_Int("TotalSeconds", pInfo[playerid][TotalSecs]); INI_Int("Wep0",pInfo[playerid][pWep0]); INI_Int("Wep1",pInfo[playerid][pWep1]); INI_Int("Wep2",pInfo[playerid][pWep2]); INI_Int("Wep3",pInfo[playerid][pWep3]); INI_Int("Wep4",pInfo[playerid][pWep4]); INI_Int("Wep5",pInfo[playerid][pWep5]); INI_Int("Wep6",pInfo[playerid][pWep6]); INI_Int("Wep7",pInfo[playerid][pWep7]); INI_Int("Wep8",pInfo[playerid][pWep8]); INI_Int("Wep9",pInfo[playerid][pWep9]); INI_Int("Wep10",pInfo[playerid][pWep10]); INI_Int("Wep11",pInfo[playerid][pWep11]); INI_Int("Wep12",pInfo[playerid][pWep12]); INI_Int("Ammo0",pInfo[playerid][pAmmo0]); INI_Int("Ammo1",pInfo[playerid][pAmmo1]); INI_Int("Ammo2",pInfo[playerid][pAmmo2]); INI_Int("Ammo3",pInfo[playerid][pAmmo3]); INI_Int("Ammo4",pInfo[playerid][pAmmo4]); INI_Int("Ammo5",pInfo[playerid][pAmmo5]); INI_Int("Ammo6",pInfo[playerid][pAmmo6]); INI_Int("Ammo7",pInfo[playerid][pAmmo7]); INI_Int("Ammo8",pInfo[playerid][pAmmo8]); INI_Int("Ammo9",pInfo[playerid][pAmmo9]); INI_Int("Ammo10",pInfo[playerid][pAmmo10]); INI_Int("Ammo11",pInfo[playerid][pAmmo11]); INI_Int("Ammo12",pInfo[playerid][pAmmo12]); INI_String("Color",pInfo[playerid][color],11); return 1; } |
INI_Float( "PositionX", PosX[ playerid ] );
INI_Float( "PositionY", PosY[ playerid ] );
INI_Float( "PositionZ", PosZ[ playerid ] );
INI_Float( "Angle", Angle[ playerid ] );
public LoginPlayer(playerid, name[], value[])
{
INI_Int("Level", pInfo[playerid][pLevel]);
INI_Int("Donator", pInfo[playerid][Donator]);
INI_Int("Banned", pInfo[playerid][Banned]);
INI_Int("Kills", pInfo[playerid][Kills]);
INI_Int("Deaths", pInfo[playerid][Deaths]);
INI_Int("Muted", pInfo[playerid][Muted]);
INI_Int("Score", pInfo[playerid][Score]);
INI_Int("Cash", pInfo[playerid][Cash]);
INI_Int("Skin", pInfo[playerid][Skin]);
INI_String("LastLoggedIP", pInfo[playerid][IP], 16);
INI_Int("TotalSeconds", pInfo[playerid][TotalSecs]);
INI_Int("Wep0",pInfo[playerid][pWep0]);
INI_Int("Wep1",pInfo[playerid][pWep1]);
INI_Int("Wep2",pInfo[playerid][pWep2]);
INI_Int("Wep3",pInfo[playerid][pWep3]);
INI_Int("Wep4",pInfo[playerid][pWep4]);
INI_Int("Wep5",pInfo[playerid][pWep5]);
INI_Int("Wep6",pInfo[playerid][pWep6]);
INI_Int("Wep7",pInfo[playerid][pWep7]);
INI_Int("Wep8",pInfo[playerid][pWep8]);
INI_Int("Wep9",pInfo[playerid][pWep9]);
INI_Int("Wep10",pInfo[playerid][pWep10]);
INI_Int("Wep11",pInfo[playerid][pWep11]);
INI_Int("Wep12",pInfo[playerid][pWep12]);
INI_Int("Ammo0",pInfo[playerid][pAmmo0]);
INI_Int("Ammo1",pInfo[playerid][pAmmo1]);
INI_Int("Ammo2",pInfo[playerid][pAmmo2]);
INI_Int("Ammo3",pInfo[playerid][pAmmo3]);
INI_Int("Ammo4",pInfo[playerid][pAmmo4]);
INI_Int("Ammo5",pInfo[playerid][pAmmo5]);
INI_Int("Ammo6",pInfo[playerid][pAmmo6]);
INI_Int("Ammo7",pInfo[playerid][pAmmo7]);
INI_Int("Ammo8",pInfo[playerid][pAmmo8]);
INI_Int("Ammo9",pInfo[playerid][pAmmo9]);
INI_Int("Ammo10",pInfo[playerid][pAmmo10]);
INI_Int("Ammo11",pInfo[playerid][pAmmo11]);
INI_Int("Ammo12",pInfo[playerid][pAmmo12]);
INI_String("Color",pInfo[playerid][color],11);
INI_Int("PositionX", PosX[playerid];
INI_Int("PositionY", PosY[playerid];
INI_Int("PositionZ", PosZ[playerid];
INI_Int("Angle", Angle[playerid]);
return 1;
}
You missed the loading of the positions..
pawn Код:
|
error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" warning 213: tag mismatch
The below warning was from what you added
![]() Код:
error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" error 017: undefined symbol "INI_Int" warning 202: number of arguments does not match definition error 001: expected token: ",", but found ";" warning 213: tag mismatch |
INI_Int("PositionX", PosX[playerid]);
INI_Int("PositionY", PosY[playerid]);
INI_Int("PositionZ", PosZ[playerid]);
INI_Int("Angle", Angle[playerid]);