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

i created script like this
Код:
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
Код:
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?
Reply
#2

show dialog id 7355 response kindly.
Reply
#3

The whole script is only for one bomb, either code for two bombs or disable the ability to buy two bombs.
And also wrong code you had to show the dialogid 7355
Reply
#4

here
Код:
if(dialogid == 7355)
        {
          if(response)
          if(!response) return TogglePlayerControllable(playerid,1);
          {
             new code = strval(inputtext);
		     if(code == 7355608)
		     {
                bactv[bom] = 0;
                TogglePlayerControllable(playerid,1);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                   GameTextForPlayer(i, "Bomb Has Been Defused!! :D Yaaay", 4000, 4);
                   DestroyObject(bom);
                }
             }
             else
             {
                SendClientMessage(playerid, 0xFFFFFFFF, "Wrong Code!!!");
                TogglePlayerControllable(playerid,1);
             }
          }
          return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)