Hlp again :D
#1

How to attach farm trailer to tractor?
Reply
#2

Take a look here my friend
https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle
Reply
#3

Use AttachTrailerToVehicle like

AttachTrailerToVehicle(farm_trailer_vehid, tractor_vehid);

PS: You need to create the trailer like a normal vehicle (via AddStaticVehicle/ CreateVehicle)
Reply
#4

Tnx, but can you explain how i can make it like cmd and where i need to puti it ?
Reply
#5

pawn Код:
CMD:attachtrailer(playerid, params[])
{
          new vehicleid = GetPlayerVehicleID(playerid);          
          if(GetVehicleModel(vehicleid) != 531) return SendClientMessage(playerid, -1, "You aren't driving a tractor");
          if(IsTrailerAttachedToVehicle(vehicleid)) return SendClientMessage(playerid, -1, "You already have a trailer attached");
          new Float:x, Float:y, Float:z;
          GetPlayerPos(playerid, x, y, z);
          new trailer = CreateVehicle(610, x, y, z+2, 1.0, 0, 0, -1, 0);
          AttachTrailerToVehicle(trailer, vehicleid);
          SendClientMessage(playerid, -1, "You have attached a farm trailer to your tractor.");
          return 1;
}
Untested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)