Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

when i plant 2 bomb, and defuse the number 2 bomb, my bomb 1 got defused too

$
0
0
i created script like this
Code:

CMD:plant(playerid, params[])
{
  if(PlayerInfo[playerid][pBombAccess] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "you need access if you want to use c4, go to electronic shop near pizza");
  {
          if(!IsPlayerInAnyVehicle(playerid))
          {
        new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
        bom = CreateObject(1252, X, Y, Z-1, 0.0, 0.0, 90.0);
        bactv[bom] = 1;
        SetObjectRot(bom, 901, 270, 270);
        SetTimerEx("SOUND1", 1000, false, "i", playerid);
      }
      else
      {
                SendClientMessage(playerid, 0xFFFFFFFF, "you need to be on foot to plant bomb!");
          }
  }
  return 1;
}

and when i plant 2 bomb, and then defuse it, my bomb number 1 got defused too
defuse cmd
Code:

CMD:def(playerid, params[])
{
  new Float:X, Float:Y, Float:Z;
  GetObjectPos(bom,X,Y,Z);
  if (!IsPlayerInRangeOfPoint(playerid, 2.0, X, Y, Z)) return SendClientMessage(playerid, 0xFFFFFFFF, "there is no bomb on range, you maybe need to get closer to the bomg or there is no bomb near you!");
  {
          if(bactv[bom] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "The Bomb is not Active!");
          {
                if(!IsPlayerInAnyVehicle(playerid))
                {
            ShowPlayerDialog(playerid, 7355, DIALOG_STYLE_INPUT, "Bomb Defuse!", "Enter Password To Defuse Bomb!!!!", "Defuse!", "RIP");
            TogglePlayerControllable(playerid,0);
        }
        else
        {
                        SendClientMessage(playerid, 0xFFFFFFFF, "you need to be on foot to defuse bomb!");
                }
          }
  }
  return 1;
}

can anyone help me fix this? :(

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>