06.11.2015, 19:38
i am trying to do a save car position
and then it will go to a file but didnt succes,
here is the code that i maked but it
code :
the /savevehicle savethe file on the folder
but the command /getvehicle didnot get the cars
anyone can help me please
and then it will go to a file but didnt succes,
here is the code that i maked but it
code :
the /savevehicle savethe file on the folder
but the command /getvehicle didnot get the cars
anyone can help me please
PHP код:
if(!strcmp(cmd, "/savevehicle", true))
{
new Float:pos[4], Model, VehiclePath[50], PlayerVehicleID;
PlayerVehicleID = GetPlayerVehicleID(playerid);
format(VehiclePath, 50, "vehicless/%d.ini", PlayerVehicleID);
Model = GetVehicleModel(PlayerVehicleID);
GetVehiclePos(PlayerVehicleID, pos[0], pos[1], pos[2]);
GetVehicleZAngle(PlayerVehicleID, pos[3]);
dini_Create(VehiclePath);й
dini_IntSet(VehiclePath, "Model", Model);
dini_FloatSet(VehiclePath, "X", pos[0]);
dini_FloatSet(VehiclePath, "Y", pos[1]);
dini_FloatSet(VehiclePath, "Z", pos[2]);
dini_FloatSet(VehiclePath, "A", pos[3]);
return 1;
}
if(!strcmp(cmd, "/getvehicle", true))
{
new VehicleToGet[256], VehiclePath[50], Float:pos[4], Model;
format(VehiclePath, 50, "vehicless/%d.ini", strval(VehicleToGet));
Model = dini_Int(VehiclePath, "Model");
pos[0] = dini_Float(VehiclePath, "X");
pos[1] = dini_Float(VehiclePath, "Y");
pos[2] = dini_Float(VehiclePath, "Z");
pos[3] = dini_Float(VehiclePath, "A");
CreateVehicle(Model, pos[0], pos[1], pos[2], pos[3], 0, 0, 0);
return 1;
}