IfIsAnyFBIVehNear Stock help
#1

Anyone can get this command to work ONLY when there is a FBI VEHICLE near, and when the boot is open?


Code:
CMD:weaponequip(playerid, params[])
{
    new GunID, pID, playerID, tarid;
    new vehicleid = GetClosestVehicle(playerid),engine,lights, alarm, doors, bonnet, boot, objective;
	GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(sscanf(params, "ui", pID, GunID)) return SendClientMessage(playerid, COL_ERROR, "SERVER: /weaponequip [PlayerID] [WeaponID = (1:smg|2:m4|3:sniper|4:deagle|5:armour)");
    if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COL_ERROR, "SERVER: Player is not connected!");
    if(!boot) return SendClientMessage(playerid, COL_ERROR, "SERVER: The boot of the Federal Rancher is not open!");
   	{
            switch(GunID)
            {
                  case 1:
                  {
                      GivePlayerWeapon(pID, 29, 250);
                   	  SendClientMessage(tarid, 0x00FF00FF, "You have been equipped with a SMG.");
                  }
                  case 2:
                  {
                      GivePlayerWeapon(pID, 31, 400);
                      SendClientMessage(tarid, 0x00FF00FF, "You have been equipped with a M4.");
                  }
                  case 3:
                  {
                      GivePlayerWeapon(pID, 34, 30);
                      SendClientMessage(tarid, 0x00FF00FF, "You have been equipped with a Sniper.");
                  }
                  case 4:
                  {
                      GivePlayerWeapon(pID, 24, 250);
                      SendClientMessage(tarid, 0x00FF00FF, "You have been equipped with a Desert Eagle.");
                  }
                  case 5:
                  {
                       SetPlayerArmour(pID, 100.0);
                       SendClientMessage(tarid, 0x00FF00FF, "You have been equipped with Armour.");
                  }
                  default:
                  {
                    return SendClientMessage(tarid, COL_ERROR, "SERVER: Choose between 1-5.");
                  }
            }
    }
    return 1;
}
Reply


Messages In This Thread
IfIsNearFBIVeh help - by MarioKamani - 02.03.2018, 10:22
Re: IfIsAnyFBIVehNear Stock help - by PepsiCola23 - 02.03.2018, 10:57
Re: IfIsAnyFBIVehNear Stock help - by MarioKamani - 02.03.2018, 12:35
Re: IfIsAnyFBIVehNear Stock help - by PepsiCola23 - 02.03.2018, 12:39
Re: IfIsAnyFBIVehNear Stock help - by MarioKamani - 02.03.2018, 17:20

Forum Jump:


Users browsing this thread: 1 Guest(s)