23.10.2011, 14:06
You need the plane interior coordinates. If they are in range, the bomb will drop, if not it will return an error message.
When you use the CreateExplosion function, make the coordinates somewhere on the ground or something, since it's falling from a plane, downward.
When you use the CreateExplosion function, make the coordinates somewhere on the ground or something, since it's falling from a plane, downward.
pawn Код:
// in a /bomb command for example:
if(strcmp("/bomb", cmdtext, true, 5) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,x,y,z)) // plane interior coordinates
{
GameTextForAll("~w~the bomb has been ~r~~n~dropped ~n~~w~exploding in ~p~10 sec",5000,3);
SetTimerEx("Bomb",10000,false,"d",playerid);
return 1;
} else return SendClientMessage(playerid,-1,"You Must Be In A Plane To Use This Command.");
}
// bottom of script
forward Bomb(playerid);
public Bomb(playerid)
{
GameTextForAll("~w~the ~r~bomb ~w~has ~r~exploded!",5000,3);
CreateExplosion(x,y,z,type,Float:Radius);
return 1;
}