Save car to file
#1

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.
Reply
#2

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");
}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)