home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
Script
/
Source
/
Test
/
Bridge_dest.sma
< prev
next >
Wrap
Text File
|
2005-03-11
|
3KB
|
119 lines
#include "script.inc"
new Float:CsobbPoz[5][vec3]={
{-4.8246331,-0.744405,-0.0000067},
{-4.883832,3.5666296,-0.0000067},
{-8.2363024,-6.0819902,-0.0000067},
{-6.3514895,-10.7527256,-0.0000067},
{-5.4353881,-4.9069052,-0.0000067}};
public main() // A palya belepesi pontja, helyette a PostGameStart fuggvenyt hasznald
CommonAKMain();
//======================================================================================================
public PostGameStart()
{
// Some must have stuff:
CommonAKInit();
AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train1" ), UNIT_DIED );
AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train2" ), UNIT_DIED );
AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train3" ), UNIT_DIED );
AddAKEntityEvent( "FunctionName", ANY_ENTITY, TEST_EVENT );
}
public FunctionName()
{
RemoveEvent( "FunctionName" );
DamageEntity( GetEntity( "bridge_train1" ), 1000.0, 49 );
}
//======================================================================================================
public Bridge_Dest(DrID:DasBridge)
{
RemoveEvent( "Bridge_Dest" );
ShowShortMessage( "Dest!" );
new DrID:UjBridge=GetNearestEntity(DasBridge,"animdest");
if(UjBridge==DrID:0)
{
ShowShortMessage( "Nem talaltam!" );
return;
}
DeActivateEntity( DasBridge );
ActivateEntity( UjBridge);
SetPropertyBool( UjBridge, "Invisible", false);
SetPropertyBool( UjBridge, "Visible", true);
SetPropertyBool( UjBridge, "HideModel", false);
PlayAnim(UjBridge, "TRACK", 2.0);
RemoveFromGroup( "animdest", UjBridge);
Csobbantas(UjBridge);
}
public CsobbanasControl()
{
RemoveEvent( "CsobbanasControl" );
Csobbantas(DrID:0);
}
public Csobbantas(DrID:UjBridge)
{
static HidNeve[166];
if(UjBridge==DrID:0)
{
UjBridge=GetEntity( HidNeve );
}
else
{
GetPropertyString( UjBridge, "StringID", 166, HidNeve );
}
static cik=-1;
new Melyik[166];
switch(cik)
{
case -1:
{
AddTimerEvent( "CsobbanasControl", 1.8, "GameLogic", true);
cik++;
return;
}
case 0:
{
AddTimerEvent( "CsobbanasControl", 0.35, "GameLogic", true);
Melyik="particle_vizcsobbanas";
}
case 1:
{
AddTimerEvent( "CsobbanasControl", 0.25, "GameLogic", true);
Melyik="particle_vizcsobbanas_kicsi";
}
case 2:
{
AddTimerEvent( "CsobbanasControl", 0.01, "GameLogic", true);
Melyik="particle_vizcsobbanas";
}
case 3:
{
AddTimerEvent( "CsobbanasControl", 0.02, "GameLogic", true);
Melyik="particle_vizcsobbanas_kicsi";
}
case 4:
{
Melyik="particle_vizcsobbanas_kicsi";
}
}
new Float:DasMainPoz[vec3];
GetPropertyVec3( UjBridge, "Pos", DasMainPoz );
new Float:NewPozz[vec3];
new Float:Direkson=GetEntityDir( UjBridge, DB_X_AXIS );
Direkson-=90.0;
NewPozz=CsobbPoz[cik];
RotateVec2(NewPozz,Direkson)
NewPozz[vec3:x]+=DasMainPoz[vec3:x];
NewPozz[vec3:y]+=DasMainPoz[vec3:y];
NewPozz[vec3:z]=-0.5;
new DrID:Bluggy=CreateEntity( Melyik, NewPozz );
DeActivateEntity( Bluggy );
cik++;
}
//======================================================================================================
//======================================================================================================
// new DrID:Bridge_animdest_obj = CreateEntity2Ent("bridge_train_animdest", ItEntity(i1), false);