23.10.2011, 13:48
i want to make a FS that drops bombs from plane i want to make it myself.... So please help me by giving hints that how can i do that !!!
// in a /bomb command for example:
if(strcmp("/bomb", cmdtext, true, 5) == 0)
{
GameTextForAll("~w~the bomb has been ~r~~n~dropped ~n~~w~exploding in ~p~10 sec",5000,3);
SetTimerEx("Bomb",10000,false,"d",playerid); // bomb timer set for 10sec, will not repeat
return 1;
}
// 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;
}
// 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;
}
// top of script
new bomb;
// in a /bomb command for example:
if(strcmp("/bomb", cmdtext, true, 5) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,x,y,z)) // plane interior coordinates
{
new float: x, y, z, a, VID;
VID = GetPlayerVehicleID(playerid);
GameTextForAll("~w~the bomb has been ~r~~n~dropped ~n~~w~exploding in ~p~10 sec",5000,3);
GetVehiclePos(VID, x, y, z);
GetVehicleZAngle(VID, a);
Bomb = CreateObject(bombobjectid, x, y, z, RotX, RotY, a);
MoveObject(Bomb, x, y, z, speed);
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;
}
is that the command that i need to use when i want to drop bombs by just pressing fire button my keyboard
|
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
if(IsPlayerInRangeOfPoint(playerid,10,x,y,z)) // plane interior coordinates
{
new float: x, y, z, a, VID;
VID = GetPlayerVehicleID(playerid);
GameTextForAll("~w~the bomb has been ~r~~n~dropped ~n~~w~exploding in ~p~10 sec",5000,3);
GetVehiclePos(VID, x, y, z);
GetVehicleZAngle(VID, a);
Bomb = CreateObject(bombobjectid, x, y, z, RotX, RotY, a);
MoveObject(Bomb, x, y, z, speed);
SetTimerEx("Bomb",10000,false,"d",playerid);
} else return SendClientMessage(playerid,-1,"You Must Be In A Plane To Use This Command.");
}
return 1;
}