12.05.2013, 04:36
How to tow a vehicle with a tower ? Noob question
COMMAND:tow(playerid,params[])
{
#pragma unused params
if(StateDriver[playerid])
{
new vehicleid=GetPlayerVehicleID(playerid);
if(IsTrailerAttachedToVehicle(vehicleid))
DetachTrailerFromVehicle(vehicleid);
else
{
new trailerid=GetClosestVehicle(playerid,vehicleid);
if(trailerid!=vehicleid && IsPlayerInRangeOfVehicle(playerid,10.0,trailerid))
AttachTrailerToVehicle(trailerid,vehicleid);
}
}
else
SendClientMessage(playerid,0xAA3333AA,"You must be in vehicle to Tow.");
return 1;
}
CMD:some(playerid)