home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
Script
/
Source
/
antiair.inc
< prev
next >
Wrap
Text File
|
2005-03-11
|
3KB
|
104 lines
/*
#include antiair.inc
HackAntiAirInit();
*/
public HackAntiAirInit()
{
RemoveEvent( "HackAntiAirSomeArea" );
RemoveEvent( "HackAntiAirKovesd" );
new Iterator:iti=Iterate("antiair");
new DrID:HAAIArea;
new lTmpStr[166];
new lTmpStr2[166];
new Float:lTmpVec3[vec3];
while(ItNext(iti))
{
GetPropertyVec3( ItEntity(iti), "Pos", lTmpVec3);
GetPropertyString( ItEntity(iti), "StringID", 146, lTmpStr );
ConcatString( lTmpStr2, 166, lTmpStr, "area" );
if(GetEntity( lTmpStr2 )==DrID:0)
{
AddAKEntityEvent( "HackAntiAirMeghalt", ItEntity(iti), UNIT_TEAM_CHANGED);
HAAIArea=CreateEntity( "sys_circlearea", lTmpVec3 );
SetPropertyFloat( HAAIArea, "Radius", 55.0 );
SetPropertyString( HAAIArea, "StringID", lTmpStr2 );
AddToGroup( "HackAntiAirArea", HAAIArea );
}
CmdSetWM( ItEntity(iti), Q_ENQUEUE, WM_GROUND );
}
AddAKEntityEvent( "HackAntiAirSomeArea", ANY_ENTITY, UNIT_AREA_ENTER);
AddTimerEvent( "HackAntiAirKovesd", 1.0 );
}
public HackAntiAirSomeArea(DrID:UndWho)
{
new DrID:UndWhere=GetMsgParamObject();
new DrID:AzAntiAirMaga;
new lTmpStr[166];
if(IsInSelector(UndWhere, "HackAntiAirArea" )&&IsInstanceOf( UndWho, GetClassID( "cAirplane") ))
{
GetPropertyString( UndWhere, "StringID", 166, lTmpStr );
StrMid(lTmpStr,lTmpStr,0,(strlen(lTmpStr)-4));
AzAntiAirMaga=GetEntity( lTmpStr );
CmdSetWM( AzAntiAirMaga, Q_OVERRIDE, WM_AIR );
CmdAttack( AzAntiAirMaga, Q_ENQUEUE, UndWho );
AddAKEntityEvent( "HackAntiAirBackToGround", AzAntiAirMaga, UNIT_END_COMBAT );
}
}
public HackAntiAirMeghalt(DrID:UndWho)
{
new lTmpStr[166];
new lTmpStr2[166];
GetPropertyString( UndWho, "StringID", 146, lTmpStr );
ConcatString( lTmpStr2, 166, lTmpStr, "area" );
if(GetEntity( lTmpStr2 )!=DrID:0)
{
DeActivateEntity( GetEntity( lTmpStr2 ) );
}
}
public HackAntiAirKovesd()
{
new Iterator:iti=Iterate("antiair");
new lTmpStr[166];
new lTmpStr2[166];
new Float:lTmpVec3[vec3];
while(ItNext(iti))
{
GetPropertyVec3( ItEntity(iti), "Pos", lTmpVec3);
if(lTmpVec3[vec3:x]!=0.0||lTmpVec3[vec3:y]!=0.0||lTmpVec3[vec3:z]!=0.0)
{
GetPropertyString( ItEntity(iti), "StringID", 146, lTmpStr );
ConcatString( lTmpStr2, 166, lTmpStr, "area" );
if(GetEntity( lTmpStr2 )!=DrID:0)
{
SetPropertyVec3( GetEntity( lTmpStr2 ), "Pos", lTmpVec3);
}
}
else
{
HackAntiAirMeghalt(ItEntity(iti));
}
}
}
public HackAntiAirBackToGround(DrID:UndWho)
{
RemoveEntityEvent("HackAntiAirBackToGround", UndWho);
CmdSetWM( UndWho, Q_ENQUEUE, WM_GROUND );
}
public HackAntiAirAddEntity(DrID:UndWho)
{
new HAAAE_Str[166];
GetPropertyString( UndWho, "EditorHierarchyPath", 166, HAAAE_Str )
if(CompareString( HAAAE_Str, "Dynamic/Vehicle/Anti Aircraft")==0)
{
AddToGroup( "antiair", UndWho );
HackAntiAirInit();
}
}