SA-MP Forums Archive
Help with AttachTrailerToVehicle.. - 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: Help with AttachTrailerToVehicle.. (/showthread.php?tid=300581)



Help with AttachTrailerToVehicle.. - Azzeto - 01.12.2011

PHP код:
        new Float:xFloat:yFloat:z;
        
SendClientMessage(playerid,COLOR_CARROT,"[HQ] Alright, you have the load, now drop it off at Idlewood Gas.");
        
GetPlayerPos(playerid,x,y,z);
        
trailer CreateVehicle(584,x,y-10,z,91.2363,-1,-1,1);
        
AttachTrailerToVehicle(trailer,GetPlayerVehicleID(playerid));
        
truckcp[playerid] = 2;
        
SetPlayerCheckpoint(playerid,1921.7677,-1793.5906,13.0875,5.0); 
trailer is a global variable which is new trailer; at the top of my script, problem is the trailer doesnt get attached to the truck, rep++ for help.


Re: Help with AttachTrailerToVehicle.. - Joe Staff - 01.12.2011

It might be an issue with syncronization, what you should do is link the vehicle in OnVehicleStreamIn (assuming that created vehicles call this callback)


Re: Help with AttachTrailerToVehicle.. - Azzeto - 01.12.2011

Alright, but how would I do this? Haven't used OnvehicleStreamIn Ever x.x