11.11.2009, 22:01
Hey, i have a small issue with this small bit of code, namely it doesn't actually work, it compiles fine, but won't actually attach "OBJ" (the trailer) to "TRU" (the truck)
This is under OnGameModeInit
This should spawn the vehicles, then attach them for the first time,
Then obviously during the mission, they're likely going to get destroyed somehow, so for when they respawn, i have this;
However both times, the trailer (OBJ) is not attached to it's pulling truck (TRU), any ideas?
This is under OnGameModeInit
pawn Код:
TRU = AddStaticVehicle(515,1266.4149,-2037.4900,60.2510,178.2439,-1,-1); // ROADTRAIN
OBJ = AddStaticVehicle(584,1266.7483,-2025.5421,60.2522,178.5712,24,77); // Trailer
AttachTrailerToVehicle(OBJ,TRU);
Then obviously during the mission, they're likely going to get destroyed somehow, so for when they respawn, i have this;
pawn Код:
public OnVehicleSpawn(vehicleid)
{
if(vehicleid == TRU) { SetVehicleToRespawn(OBJ); } // Set the trailer to respawn too
if(vehicleid == OBJ) { AttachTrailerToVehicle(OBJ,TRU); } // Attach it to the truck
return 1;
}