explotion bug
#1

ok i got a cmd that create explotion but when it used they dont stop how do i end the explotion.


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/basestrike", cmdtext, true, 10) == 0)
	{
	  if(spree[playerid] >= 10 || IsPlayerAdmin(playerid))
		{
		ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Base Strike", "Usa Base Strike\nGermans Base Strike\nJapan Base Strike\nMercenary Base Strike\nRussian Base Strike", "Select", "Cancel");
 		}
 		else
 		{
 		SendClientMessage(playerid,RED,"You Must Have 10 Kill Streaks");
 		}
		return 1;
	}
	return 0;
}










Код:
public usabomb()
{
	CreateExplosion(-233.97259521484, 2633.2021484375, 62.374027252197,7,20); //
	CreateExplosion(-342.97686767578, 2645.517578125, 62.374027252197,7,20); //
	CreateExplosion(-308.1311340332, 2741.7602539063, 62.374027252197,7,20); //
	CreateExplosion(-173.44599914551, 2736.9846191406, 62.374027252197,7,20); //
	return 1;
}
public germanbomb()
{
	CreateExplosion(-1459.9934082031, 2603.5158691406, 63.685111999512,7,20); //
	CreateExplosion(-1460.349609375, 2666.318359375, 63.685111999512,7,20); //
	CreateExplosion(-1417.2110595703, 2666.5600585938, 63.685111999512,7,20); //
	CreateExplosion(-1477.8121337891, 2555.8120117188, 63.685111999512,7,20); //
	return 1;
}
public japanbomb()
{
	CreateExplosion(-68.205322265625, 1202.595703125, 31.104057312012,7,20); //
	CreateExplosion(7.6469922065735, 1203.6928710938, 31.104057312012,7,20); //
	CreateExplosion(8.4740104675293, 1146.4287109375, 31.104057312012,7,20); //
	CreateExplosion(-52.749965667725, 1145.5432128906, 31.104057312012,7,20); //
	CreateExplosion(-52.136501312256, 1103.1577148438, 31.104057312012,7,20); //
	CreateExplosion(-80.392822265625, 1102.7485351563, 31.104057312012,7,20); //
	CreateExplosion(-123.14115905762, 1127.2521972656, 31.104057312012,7,20); //
	CreateExplosion(-170.87112426758, 1170.5258789063, 31.104057312012,7,20); //
	CreateExplosion(-130.69058227539, 1215.0708007813, 31.104057312012,7,20); //
	return 1;
}
public talibanbomb()
{
	CreateExplosion(-686.87591552734, 931.30694580078, 14.374816894531,7,20); //
	CreateExplosion(-680.44287109375, 959.30560302734, 14.374816894531,7,20); //
	CreateExplosion(-658.13269042969, 938.02575683594, 14.374816894531,7,20); //
	CreateExplosion(-675.60485839844, 910.60693359375, 14.374816894531,7,20); //
	return 1;
}
public russiabomb()
{
	CreateExplosion(-835.23388671875, 1550.8673095703, 29.692680358887,7,20); //
	CreateExplosion(-787.06079101563, 1569.4808349609, 29.692680358887,7,20); //
	CreateExplosion(-785.56701660156, 1515.6232910156, 29.692680358887,7,20); //
	CreateExplosion(-826.73297119141, 1509.5181884766, 29.692680358887,7,20); //
	CreateExplosion(-829.17639160156, 1597.6502685547, 29.692680358887,7,20); //
	CreateExplosion(-866.84130859375, 1596.603515625, 29.692680358887,7,20); //
	CreateExplosion(-864.77459716797, 1522.0950927734, 29.692680358887,7,20); //
	CreateExplosion(-768.34216308594, 1556.1833496094, 29.692680358887,7,20); //
	CreateExplosion(-782.17987060547, 1602.0943603516, 29.692680358887,7,20); //
	CreateExplosion(-782.1796875, 1602.09375, 29.692680358887,7,20); //
	return 1;
}
Reply
#2

same happens to me , anyone knows?
Reply
#3

have you tried a different type, such as 6 instead of 7?
Reply
#4

Quote:
Originally Posted by adsy
have you tried a different type, such as 6 instead of 7?
7 is used in /explode command we have and it has no bugs , any other suggestions :S?
Reply
#5

Show the stuff listed in OnDialogResponse for dialogid 1996
Reply
#6

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 1996 && response)
	{
	  switch(listitem)
	  {
	    case 0://usa
	    {
    	SetTimer("usabomb", 5000, 1);
			SendClientMessage(playerid,RED,"Usa Base Gonna Be Bombed In 5 Seconds , Take Cover!!!");
	    }
			case 1://german
	    {
	    SetTimer("germanbomb", 5000, 1);
	    SendClientMessage(playerid,RED,"Germans Base Gonna Be Bombed In 5 Seconds , Take Cover!!!");
			}
			case 2://japan
	    {
	    SetTimer("japanbomb", 5000, 1);
	    SendClientMessage(playerid,RED,"Japans Base Gonna Be Bombed In 5 Seconds , Take Cover!!!");
			}
			case 3://merc
	    {
	    SetTimer("mercbomb", 5000, 1);
	    SendClientMessage(playerid,RED,"Mercenaries Base Gonna Be Bombed In 5 Seconds , Take Cover!!!");
			}
			case 4://russ
	    {
	    SetTimer("russiabomb", 5000, 1);
	    SendClientMessage(playerid,RED,"Russian Base Gonna Be Bombed In 5 Seconds , Take Cover!!!");
			}

  	}
	}
	return 1;
}
Reply
#7

Spotted your problem instantly, Youve set the timer to repeat, Thats why the constant explosions
Reply
#8

so it should be : SetTimer("usabomb", 5000, 0); not one?
Reply
#9

Quote:
Originally Posted by !Vampire!
so it should be : SetTimer("usabomb", 5000, 0); not one?
Yes,

The format is: SetTimer(funcname[], interval, repeating);

And you have repeating set to 1, Resulting in constant explosions
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)