View Single Post
  #8  
Old 10-03-2011, 09:49 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

no its not a maddox variable, i declare
bool OverEnemyTeritory = false;
at the beginning of the script.
with
public override void OnTickGame()
{
//Point3d P = PlayerPlane.Pos();

if (!OverEnemyTeritory && GamePlay.gpFrontDistance(1, PlayerPlane.Pos().x, PlayerPlane.Pos().y) <= 0)
{
GamePlay.gpHUDLogCenter("Sie befinden sich nun über Feindgebiet!");
OverEnemyTeritory = true;
}
else
{
OverEnemyTeritory = false;
}
}

this checks if the plane is near or over enemy teritory
GamePlay.GamePlay.gpFrontDistance(int army, double x, double y);
returns a double that gives the distance to enemy front (if exist)
it returns 0 if you are over enemy teritory or the area you specify.
if you would know the distance to friendly teritory simply set for army the same army you are.
Before you should check with GamePlay.gpFrontExist() (returns bool) if a front (frontmarkers) exist.

Last edited by FG28_Kodiak; 10-03-2011 at 09:52 AM.
Reply With Quote