Fire Creation
#1

Okay basically i've been pondering over this, I'm looking to make a command that will set off a certain amount of "explosions" in the designated cord's I have set in my script. The thing is i'm confused on how to start so i'm going to elaborate.

Basically somebody can will type /startfire 1, 2, 3 and so on and so on every number will have a coordinate attached in which a series of explosions will happen. Then a message will display to all the members of the PD Which I can do myself thast not needed i just dont really know how to make a explosion happen at a cord that i designate. So can somebody please help me give me a basic layout of what the code should look like and i can go from there.
Reply
#2

With this :
https://sampwiki.blast.hk/wiki/CreateExplosion
Reply
#3

This is what I came up with but the explosions aren't working..... It snot creating them and I cant see why, There was no errors or warnings at all...

Maybe the type and radius are incorrect... But i cant find a list of the types or radius's on the wiki -.-

Код:
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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)