PS: You need to create the trailer like a normal vehicle (via AddStaticVehicle/ CreateVehicle)
Tnx, but can you explain how i can make it like cmd and where i need to puti it ?
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;
}