Well I made this script, to attach object but when i respawn car object remain in air
Код HTML:
new TrailerColore[2][MAX_VEHICLES];
stock SetTraillerColor(vehicleid)
{
if(IsValidDynamicObject(TrailerColore[0][vehicleid]))DestroyDynamicObject(TrailerColore[0][vehicleid]);
if(IsValidDynamicObject(TrailerColore[1][vehicleid]))DestroyDynamicObject(TrailerColore[1][vehicleid]);
TrailerColore[0][vehicleid] = CreateObject(3033, 1.374600, 3.849500, 2.06910, 0.00000, 0.00000, 90.00000);
TrailerColore[1][vehicleid] = CreateObject(3033, 1.374600, -1.04050, 2.06910, 0.00000, 0.00000, 90.00000);
AttachObjectToVehicle(TrailerColore[0][vehicleid], vehicleid, 1.37260, 3.73150, 1.96710, 0.00000, 0.00000, 90.00000);
AttachObjectToVehicle(TrailerColore[1][vehicleid], vehicleid, 1.37460, -0.96650, 1.96710, 0.00000, 0.00000, 90.00000);
cmd:irontrailer(playerid,params[])
{
SetTraillerColor(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
return 1;
}