29.10.2017, 19:29
How to attach farm trailer to tractor?
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;
}