їWhy don't save the cords? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: їWhy don't save the cords? (
/showthread.php?tid=529861)
їWhy don't save the cords? -
xHanks - 04.08.2014
When i loggin that load the cords but when i disconnect that's don't save.
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
new string[150], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "/Usuarios/%s.ini", name);
new INI:File = INI_Open(string);
GetPlayerPos(playerid, pInfo[playerid][PosX], pInfo[playerid][PosY], pInfo[playerid][PosZ]);
INI_WriteFloat( File, "PosicionX", pInfo[playerid][PosX] );
INI_WriteFloat( File, "PosicionY", pInfo[playerid][PosY] );
INI_WriteFloat( File, "PosicionZ", pInfo[playerid][PosZ] );
print(string);
}
Re: їWhy don't save the cords? -
Mauzen - 04.08.2014
You should close the ini file when all writing is done
INI_Close(File);
Else the buffer eventually isnt written to the file.