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 >
Text File  |  2005-03-11  |  3KB  |  119 lines

  1. #include "script.inc"
  2. new Float:CsobbPoz[5][vec3]={
  3. {-4.8246331,-0.744405,-0.0000067},
  4. {-4.883832,3.5666296,-0.0000067},
  5. {-8.2363024,-6.0819902,-0.0000067},
  6. {-6.3514895,-10.7527256,-0.0000067},
  7. {-5.4353881,-4.9069052,-0.0000067}};
  8.  
  9. public main() // A palya belepesi pontja, helyette a PostGameStart fuggvenyt hasznald
  10.     CommonAKMain();
  11. //======================================================================================================
  12. public PostGameStart()
  13. {
  14. // Some must have stuff:
  15.     CommonAKInit();
  16.  
  17.     AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train1" ), UNIT_DIED );
  18.     AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train2" ), UNIT_DIED );
  19.     AddAKEntityEvent( "Bridge_Dest", GetEntity( "bridge_train3" ), UNIT_DIED );
  20.  
  21.     AddAKEntityEvent( "FunctionName", ANY_ENTITY, TEST_EVENT );
  22. }
  23.  
  24. public FunctionName()
  25. {
  26.     RemoveEvent( "FunctionName" );
  27.     DamageEntity( GetEntity( "bridge_train1" ), 1000.0, 49 );
  28. }    
  29. //======================================================================================================
  30. public Bridge_Dest(DrID:DasBridge)
  31. {
  32.     RemoveEvent( "Bridge_Dest" );
  33.     ShowShortMessage( "Dest!" );
  34.     new DrID:UjBridge=GetNearestEntity(DasBridge,"animdest");
  35.     if(UjBridge==DrID:0)
  36.     {
  37.         ShowShortMessage( "Nem talaltam!" );
  38.         return;
  39.     }
  40.     DeActivateEntity( DasBridge );
  41.     ActivateEntity( UjBridge);
  42.     SetPropertyBool( UjBridge, "Invisible", false);
  43.     SetPropertyBool( UjBridge, "Visible", true);
  44.     SetPropertyBool( UjBridge, "HideModel", false);
  45.     PlayAnim(UjBridge, "TRACK", 2.0);
  46.     RemoveFromGroup( "animdest", UjBridge);
  47.     Csobbantas(UjBridge);
  48. }
  49.  
  50. public CsobbanasControl()
  51. {
  52.     RemoveEvent( "CsobbanasControl" );
  53.     Csobbantas(DrID:0);
  54. }
  55.  
  56. public Csobbantas(DrID:UjBridge)
  57. {
  58.     static HidNeve[166];
  59.     if(UjBridge==DrID:0)
  60.     {
  61.         UjBridge=GetEntity( HidNeve );
  62.     }
  63.     else
  64.     {
  65.         GetPropertyString( UjBridge, "StringID", 166, HidNeve );
  66.     }
  67.     static cik=-1;
  68.     new Melyik[166];
  69.     switch(cik)
  70.     {
  71.         case -1:
  72.         {
  73.             AddTimerEvent( "CsobbanasControl", 1.8, "GameLogic", true);
  74.             cik++;
  75.             return;
  76.         }
  77.         case 0:
  78.         {
  79.             AddTimerEvent( "CsobbanasControl", 0.35, "GameLogic", true);
  80.             Melyik="particle_vizcsobbanas";        
  81.         }
  82.         case 1:
  83.         {
  84.             AddTimerEvent( "CsobbanasControl", 0.25, "GameLogic", true);        
  85.             Melyik="particle_vizcsobbanas_kicsi";        
  86.         }
  87.         case 2:
  88.         {
  89.             AddTimerEvent( "CsobbanasControl", 0.01, "GameLogic", true);        
  90.             Melyik="particle_vizcsobbanas";        
  91.         }
  92.         case 3:
  93.         {
  94.             AddTimerEvent( "CsobbanasControl", 0.02, "GameLogic", true);        
  95.             Melyik="particle_vizcsobbanas_kicsi";        
  96.         }
  97.         case 4:
  98.         {
  99.             Melyik="particle_vizcsobbanas_kicsi";        
  100.         }
  101.     }
  102.     new Float:DasMainPoz[vec3];
  103.     GetPropertyVec3( UjBridge, "Pos", DasMainPoz );
  104.     new Float:NewPozz[vec3];
  105.     new Float:Direkson=GetEntityDir( UjBridge, DB_X_AXIS );
  106.     Direkson-=90.0;
  107.     NewPozz=CsobbPoz[cik];
  108.     RotateVec2(NewPozz,Direkson)
  109.     NewPozz[vec3:x]+=DasMainPoz[vec3:x];
  110.     NewPozz[vec3:y]+=DasMainPoz[vec3:y];
  111.     NewPozz[vec3:z]=-0.5;
  112.     new DrID:Bluggy=CreateEntity( Melyik, NewPozz );
  113.     DeActivateEntity( Bluggy );
  114.     cik++;    
  115. }
  116. //======================================================================================================
  117. //======================================================================================================
  118. //        new DrID:Bridge_animdest_obj = CreateEntity2Ent("bridge_train_animdest", ItEntity(i1), false);
  119.