SA-MP Forums Archive
attach object problem - 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)
+--- Thread: attach object problem (/showthread.php?tid=613778)



attach object problem - Mister0 - 31.07.2016

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;
}

And when I respawn car


http://i.imgur.com/TGK5exq.png
I try to destroy object before respan stil lnot work


Re: attach object problem - Shockey HD - 31.07.2016

Show us the command that you are respawning the car with.