Save car to file - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Save car to file (
/showthread.php?tid=83042)
Save car to file -
arnutisz - 22.06.2009
I am trying to make 'savecar' command. The command works and it saves car's coords to file. I am saving with dini. Here is something:
pawn Code:
dini_IntSet(file, string, 1);
I don't know what to write so am using 1 (if I don't write "1" i get warning)
And i get:
Code:
411, -1730.954101, 531.767150, 39.146366, 348.453033, -1, -1, RESPAWN_DELAY;
=1
But I don't need "=1". How i should save my car without "=1" in file?
I need:
Code:
411, -1730.954101, 531.767150, 39.146366, 348.453033, -1, -1, RESPAWN_DELAY;
But I get:
Code:
411, -1730.954101, 531.767150, 39.146366, 348.453033, -1, -1, RESPAWN_DELAY;
=1
Hope you understand.
Re: Save car to file -
ziomal396 - 22.06.2009
If you will use command what saves vehicle in dini, it overwrite, what have you saved previously
My command looks like this
Code:
if(strcmp(cmdtext,"/save",true, 5)==0)
{
new Float:Pos[3];
new Float:A;
new str[64];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid, A);
format(str,sizeof(str),"AddStaticVehicle(%i, %f, %f, %f, %f, %i, %i);\r\n",GetVehicleModel(GetPlayerVehicleID(playerid)), Pos[0],Pos[1],Pos[2], random(127), random(127));
new File:f = fopen("vehicles.txt", io_append);
fwrite(f, str);
fclose(f);
SendClientMessage(playerid,RED,"Vehicle saved");
}
Re: Save car to file -
arnutisz - 22.06.2009
But I want to do that with dini. I have made command, and function, but i get "=1" in vehicle line, and I don't need that.