OnPlayerKeyStateChange
#4

can you help with those brackets? i dont have time for them
+REP if works perfect

Код:
if((newkeys & KEY_FIRE) || (oldkeys & KEY_FIRE)) // tow command
	{
 	if(IsACop(playerid))
	if(I!sTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
	{
   		if(IsPlayerInAnyVehicle(playerid))
     	{
			new
				carid = GetPlayerVehicleID(playerid);

			if(IsATowTruck(carid))
			{
   				new
					closestcar = GetClosestCar(playerid, carid);

       			if(GetDistanceToCar(playerid,closestcar) <= 8 && !IsTrailerAttachedToVehicle(carid)) {
					foreach(Player, i) {
						if(GetPlayerVehicle(i, closestcar) != -1) {
						    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_GRAD2, "You need to be inside a vehicle to use this command!");
	}
   	else SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
	}
	else if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
	{
      	SendClientMessageEx(playerid, COLOR_GRAD1,"You have unhooked the vehicle that you were towing.");
		arr_Towing[playerid] = INVALID_VEHICLE_ID;
		DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
     	}
      	else
       	{
        	SendClientMessageEx(playerid, COLOR_GRAD1,"You are currently not towing anything.");
        }
  	}
   	else
	{
 		SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
	}
	return 1;
}
Reply


Messages In This Thread
OnPlayerKeyStateChange - by Lidor124 - 13.02.2014, 12:30
Re: OnPlayerKeyStateChange - by $Marco$ - 13.02.2014, 12:36
Re: OnPlayerKeyStateChange - by Threshold - 13.02.2014, 12:43
Re: OnPlayerKeyStateChange - by Lidor124 - 13.02.2014, 12:49
Re: OnPlayerKeyStateChange - by $Marco$ - 13.02.2014, 13:02
Re: OnPlayerKeyStateChange - by Threshold - 13.02.2014, 13:05

Forum Jump:


Users browsing this thread: 1 Guest(s)