SA-MP Forums Archive
Saving my pickups - 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: Saving my pickups (/showthread.php?tid=443124)



Saving my pickups - Sellize - 10.06.2013

So I have a dynamic pickup making system but how can I save them so they will be there after /gmx ?

Thanks


Respuesta: Saving my pickups - Parka - 10.06.2013

pawn Код:
forward PickupLog( string[] );
public PickupLog( string[] )
{
    new entry[ 256 ];
    format( entry, sizeof entry, "%s\n", string);
    new File:hFile;
    hFile = fopen("Pickups.txt", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}

//example
new string[128], Float:Pos[3];
GetPlayerPos( playerid, Pos[0], Pos[1], Pos[2] );
format( string, sizeof string, "Posx: %f, Posy: %f, Posz: %f ", Pos[0], Pos[1], Pos[2]);
PickupLog( string );