12.05.2013, 08:16
pawn Код:
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;
}