13.02.2014, 13:05
I guess so..
pawn Код:
if(newkeys & KEY_FIRE) // tow command
{
if(IsACop(playerid))
{
if(GetPlayerState(playerid, PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
if(!IsTrailerAttachedToVehicle(carid))
{
if(IsATowTruck(carid))
{
new closestcar = GetClosestCar(playerid, carid);
if(GetDistanceToCar(playerid, closestcar) <= 8.0)
{
foreach(Player, i)
{
if(GetPlayerVehicle(i, closestcar) == -1) continue;
if(ProxDetectorS(30.0, playerid, i))
{
SendClientMessageEx(i, COLOR_LIGHTBLUE, "Someone is attempting to tow your vehicle away!");
arr_Towing[playerid] = closestcar;
SendClientMessageEx(playerid, COLOR_GRAD2, "This player owned vehicle is available for impounding.");
return AttachTrailerToVehicle(closestcar,carid);
}
}
SendClientMessageEx(playerid, COLOR_GRAD2, "This vehicle has no registration, it is available for impounding.");
AttachTrailerToVehicle(closestcar,carid);
arr_Towing[playerid] = closestcar;
return 1;
}
}
else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to tow with this vehicle.");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1,"You have unhooked the vehicle that you were towing.");
arr_Towing[playerid] = INVALID_VEHICLE_ID;
DetachTrailerFromVehicle(carid);
}
}
else SendClientMessageEx(playerid, COLOR_GRAD2, "You need to be the driver of a vehicle to use this command!");
}
else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
return 1;
}