SA-MP Forums Archive
Fire Command issue.... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Fire Command issue.... (/showthread.php?tid=112236)



Fire Command issue.... - Leethan - 06.12.2009

This is the command.... No wthe issue i'm having is you CAN type /fire it will tell me i typed it and display USAGE: /fire [explosion id],,, but it doesn't create the explosions. Personally i dont see anything wrong with the command or what it is so can somebody help me out?

And yes i know i'm missing some cords but that doesn't explain the explosions not working....


Код:
new FDexplosionTimer;

forward FDexploion(playerid, exid);
public FDexploion(playerid, exid)
{
	if(exid == 1)
	{
		CreateExplosion(1054.7498,2119.7910,17.1421, 12, 10.0);
		CreateExplosion(1054.9277,2098.3821,17.6068, 12, 10.0);
		CreateExplosion(1089.8647,2082.0396,15.3504, 12, 10.0);
		CreateExplosion(1091.4241,2103.1821,15.3504, 12, 10.0);
		CreateExplosion(1064.3367,2091.4470,10.8203, 12, 10.0);
		CreateExplosion(1072.7781,2100.8748,10.8203, 12, 10.0);
		CreateExplosion(1071.6128,2106.6973,10.8203, 12, 10.0);
		CreateExplosion(1061.5072,2106.9614,10.8203, 12, 10.0);
		CreateExplosion(1083.8412,2121.7385,10.8203, 12, 10.0);
		CreateExplosion(1055.1442,2091.2813,18.3076, 12, 10.0);
		CreateExplosion(1055.3341,2106.4451,18.7475, 12, 10.0);
		return 1;
	}
	if(exid == 2)
	{
		CreateExplosion(0,0,0,0,0);
		return 1;
	}
	else if (PlayerInfo[playerid][pmember] >= 3)
	{
		if(exid == 1 && IsPlayerInRangeOfPoint(playerid, 5, 0, 0, 0))
		{
			KillTimer(FDexplosionTimer);
			return 1;
		}
		if(exid == 2 && IsPlayerInRangeOfPoint(playerid, 5, 0, 0, 0))
		{
			KillTimer(FDexplosionTimer);
			return 1;
		}
	}
	return 1;
}

stock SendMessageTopmember(color, message[])
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
	 if (IsPlayerConnected(i))
	 {
		 if (PlayerInfo[i][pmember] >= 3)
		 {
			SendClientMessage(i, color, message);
		}
	 }
  }
  return 1;
}

dcmd_fire(playerid, params[])
{
	new exid, msg[128];
	if(sscanf(params, "i", exid)) SendClientMessage( playerid, COLOR_WHITE, "USAGE: /fire [explosion id]" );
	else if(exid < 0) SendClientMessage( playerid, COLOR_RED, "* Invalid Explosion id." );
	else if(PlayerInfo[playerid][pAdmin] >= 2)
	{
	  if(exid == 1)
	  {
	  	FDexplosionTimer = SetTimerEx("FDexplosion", 10000, 1, "i", exid);
	  	SendMessageTopmember(COLOR_YELLOW, "blah");
	  	return 1;
		}
		if(exid == 2)
		{
			FDexplosionTimer = SetTimerEx("FDexplosion", 10000, 1, "i", exid);
			SendMessageTopmember(COLOR_YELLOW, "blah");
			return 1;
		}
	}
	return 1
}



Re: Fire Command issue.... - lolumadd - 08.12.2009

Have you put dcmd_fire(playerid, params[]); under OnPlayerCommandText?


Re: Fire Command issue.... - Daren_Jacobson - 08.12.2009

@lolumadd:
dcmd is not called like that, simply putting
dcmd(fire, 4, cmdtext);
in OnPlayerCommandText is all dcmd needs

as for your problem ... I got nothing.


Re: Fire Command issue.... - Sew_Sumi - 08.12.2009

Your ifs are real "odd"


I dunno, Seems to look "odd" in a few areas... Mainly the command to the function section...


Rewrite it after reading some... You'll figure another way of making that code.