09.07.2018, 19:37
Try something like this
Not tested it, but it should work.
PHP код:
stock SaveTrailers(trailerID) {
new
sz_Entry[128],
File: fileHandle = fopen("trailers.txt", io_append),
Float:tmpCoords[3];
new trailerModel = GetVehicleModel(trailerID);
GetVehiclePos(trailerID, tmpCoords[0], tmpCoords[1], tmpCoords[2]);
format(sz_Entry, sizeof(sz_Entry), "CreateVehicle(%d, %f, %f, %f, 0, -1, -1, 6000000);", trailerModel, tmpCoords[0], tmpCoords[1], tmpCoords[2]);
fwrite(fileHandle, sz_Entry);
return fclose(fileHandle);
}
PHP код:
CMD:printtrailer(playerid, params[])
{
SaveTrailers(GetPlayerVehicleID(playerid));
SendClientMessageToAll(-1, "Saved this Trailer");
return 1;
}