daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Nov 21st, 2017 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxx/amxmodx>
  2. #include <fakemeta>
  3. #include <ipci/ascend>
  4. #include <ipci/Fxlib>
  5. #include <engine>
  6.  
  7. #define MOD_SOUND   0
  8. #define MOD_CHARGE  0
  9. #define MOD_WEAPON  0
  10.  
  11. new bool:tie[32];
  12. new CloudSphere;
  13. new bool:loop[32];
  14.  
  15.  
  16.  
  17. // << Implement CX Interface >>
  18. #include <xtension/class/main>
  19. #include <xs>
  20.  
  21. PluginInit ()
  22. {
  23.     register_plugin("AdvMeleeMod", "1337", "BANDIT / C4 / Matias_Esf");
  24.    
  25.     register_message(get_user_msgid("MeleeTxtHud"), "MeleeText");
  26.     register_message(get_user_msgid("MeleeTxtHud"), "AdvMeleeStates");
  27.    
  28.     // client commands just for testing. remove if no longer needed.
  29.     //register_clcmd("fx", "NewFX");
  30.     //register_clcmd("nofx", "RemoveFX");
  31. }
  32.  
  33. PluginPreCache ()
  34. {
  35.     precache_model( "sprites/stmbal1.spr" );
  36.     precache_model( "sprites/white.spr" );
  37.     precache_model( "sprites/ecx.lightning.spr" );
  38.     precache_model( "sprites/lightning.spr" );
  39.     precache_model( "sprites/ywaves.spr" );
  40.     precache_model( "models/evolution/Auras/shape_C.mdl" );
  41.     precache_model( "sprites/rcharge.spr" );
  42.     precache_model( "sprites/ecx.cooler.spr" );
  43.     precache_model( "sprites/ecx.lightning.spr" );
  44.     precache_model( "sprites/onda.spr" );
  45. }
  46.  
  47. public client_PostThink( Client )
  48. {
  49.     if( pev( Client, pev_sequence ) ==  126 )
  50.     {
  51.         client_cmd(Client, "say Adv Meele!");
  52.         set_task(0.0,"Fastfight",Client);
  53.         AddFx( Client, "fxPowerup", 0, 0, 0 );
  54.     }
  55.     if( pev( Client, pev_sequence ) ==  127 )
  56.     {
  57.         client_cmd(Client, "say Adv Meele!");
  58.         set_task(0.0,"Fastfight",Client);
  59.         AddFx( Client, "fxPowerup", 0, 0, 0 );
  60.     }
  61.     else if
  62.     {
  63.         //RemFx( Client, "fxAvatar", 0);
  64.         //RemFx( Client, "fxPowerup", 0);
  65.     }
  66. }
  67.  
  68. public Fastfight (Client)
  69. {
  70.     if(loop)
  71.         set_task(1.0,"Fastfight",Client);
  72.  
  73.     setClientANIMATION(Client,random_num(129,152) ,2.0)
  74. }
  75.  
  76. public AdvMeleeStates(MsgID, dest, id)
  77. {
  78.     client_print(id, print_chat, "MsgID: %d , dest: %d , args#: %d",MsgID, dest, get_msg_args());
  79.  
  80.     for(new i = 1; i <= get_msg_args(); i++)
  81.     {
  82.         client_print(id, print_chat, "arg%d: %d",i,get_msg_arg_int(i));
  83.     }
  84. }
  85.  
  86. // client command function just for testing. remove if no longer needed.
  87. public NewFX(id)
  88. {
  89.     //client_print(id, print_console, "NewFX on id %d", id);
  90.    
  91.     set_task(1.0,"Effects",id);
  92.    
  93.     return 1;
  94. }
  95.  
  96. // client command function just for testing. remove if no longer needed.
  97. public RemoveFX(id)
  98. {
  99.     //client_print(id, print_console, "RemoveFX");
  100.    
  101.     set_task(1.0,"RemoveAll",id);
  102.    
  103.     return 1;
  104. }
  105.  
  106. public MeleeText(MsgID, dest, id)
  107. {
  108.     // output just for testing. remove if no longer needed.
  109.     //client_print(id, print_chat, "variable: %d",get_msg_arg_int(1))
  110.  
  111.     if(get_msg_arg_int(1) == 11 )       // Blockbreaker
  112.     {
  113.         Rays(id);
  114.         set_task(0.1,"Effects2",id);
  115.         AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
  116.         set_task(2.0,"RemoveAll",id);
  117.        
  118.         tie[id] = false;
  119.     }
  120.     else if(get_msg_arg_int(1) == 12 )  // Win
  121.     {
  122.         set_task(2.0,"RemoveAll",id);
  123.         AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
  124.        
  125.         tie[id] = false;
  126.     }
  127.     else if(get_msg_arg_int(1) == 13 )  // Loser
  128.     {
  129.         set_task(2.0,"RemoveAll",id);
  130.        
  131.         tie[id] = false;
  132.     }
  133.     else if(get_msg_arg_int(1) == 14 )  // Tie
  134.     {
  135.         if(tie[id])
  136.         {
  137.             set_task(2.0,"RemoveAll",id);
  138.            
  139.             tie[id] = false;
  140.         }
  141.         else
  142.         {
  143.             Rays(id);
  144.             set_task(0.1,"Effects2",id);
  145.             AddFx( id, "fxScreenShake", 50.0, 5.0, 5.0 );
  146.             AddFx( id, "fxBlow" );
  147.            
  148.             tie[id] = true;        
  149.         }
  150.     }
  151.     else if(get_msg_arg_int(1) == 15 )  // Headon
  152.     {
  153.         Rays(id);
  154.         CloudSphereFX(id);
  155.         set_task(0.1,"Effects",id);
  156.         //set_task(4.8,"RemoveAll",id);
  157.         AddFx( id, "fxScreenShake", 50.0, 5.0, 5.0 );   // Effects already got a screenshake!
  158.         AddFx( id, "fxBlow" );                          // Effects already got multiple blows!
  159.         AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
  160.     }
  161.     else if(get_msg_arg_int(1) == 16 )  // Powerhit
  162.     {
  163.         Rays(id);
  164.         set_task(0.1,"Effects2",id);
  165.         set_task(0.8,"RemoveAll",id);
  166.         set_task(1.0,"RT",id);
  167.         //remove_task(id)
  168.        
  169.         tie[id] = false;
  170.     }
  171. }
  172.  
  173.  
  174. public RT(id)
  175. {
  176.     remove_task(id)
  177. }
  178.  
  179.  
  180. public Rays(id)
  181. {
  182.     static Float:Origin[3];
  183.     entity_get_vector(id, EV_VEC_origin, Origin);
  184.    
  185.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  186.     {
  187.         write_byte(TE_BEAMENTPOINT);
  188.         write_short(id | 0x1000);
  189.         write_coord(floatround(Origin[0])+ random_num(-10, 10));
  190.         write_coord(floatround(Origin[1])+ random_num(-10, 10));
  191.         write_coord(floatround(Origin[2])+ random_num(-10, 10));
  192.         write_short( engfunc( EngFunc_ModelIndex,"sprites/lgtning.spr" ) );
  193.         write_byte(2); // Starting Frame
  194.         write_byte(3); // Framerate
  195.         write_byte(20); // Life
  196.         write_byte(10); // Width
  197.         write_byte(50); // Noise
  198.         write_byte(255); // Red
  199.         write_byte(255); // Green
  200.         write_byte(255); // Blue
  201.         write_byte(138); // Brightness
  202.         write_byte(55); // Speed
  203.     }
  204.     message_end();
  205. }
  206.  
  207. public CloudSphereFX( id )
  208. {
  209.     new org[3];
  210.     get_user_origin(id, org);
  211.    
  212.     for(new i; i < 30; i++)
  213.     {
  214.         message_begin( MSG_PVS, SVC_TEMPENTITY, org );
  215.         {
  216.             write_byte( TE_BEAMENTPOINT );
  217.             write_short( id ); //start entity
  218.             write_coord( org[0] + random_num(-200, 200)); //end position X
  219.             write_coord( org[1] + random_num(-200, 200)); //end position Y
  220.             write_coord( org[2] + random_num(-200, 200)); //end positon Z
  221.             write_short( CloudSphere ); //set spr file
  222.             write_byte( 3 ); //starting frame
  223.             write_byte( 5 ); //frame rate in 0.1's
  224.             write_byte( 90 ); //life in 0.1's
  225.             write_byte( 255 ); //line width in 0.1's
  226.             write_byte( 0 ); //noise amplitude in 0.01's
  227.             write_byte( 10 ); //R
  228.             write_byte( 10 ); //G
  229.             write_byte( 10 ); //B
  230.             write_byte( 250 ); //Brightness
  231.             write_byte( 20 ); //scroll speed in 0.1's
  232.         }
  233.         message_end( );
  234.     }
  235. }
  236.  
  237. public Effects(id)
  238. {
  239.     AddFx( id, "fxLgtField", 0.2, 3, 255, 100);
  240.     AddFx( id, "fxWorldLight", 90, 255, 255, 255, 200.1, 0.5);
  241.     AddFx( id, "fxPowerup", 0, 0, 0 );
  242.     AddFx( id, "fxBlow" );
  243.     AddFx( id, "fxScreenShake", 50.0, 3.0, 4.0 );
  244.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  245.     AddFx( id, "fxBlow" );
  246.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  247.     AddFx( id, "fxBlow" );
  248.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  249.     AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
  250.     AddFx( id, "fxSprite", "sprites/ywaves.spr", 6, 60, 0, 0, 0 );
  251.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 90, 250);
  252.     set_task(2.0,"Rays",id);
  253.     set_task(2.0,"Extra",id);
  254. }
  255.  
  256. public Effects2(id)
  257. {
  258.     AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
  259.     //AddFx( id, "fxPowerup", 0, 0, 0 );
  260.     AddFx( id, "fxBlow" );
  261.     AddFx( id, "fxScreenShake", 50.0, 3.0, 4.0 );
  262.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  263.     AddFx( id, "fxBlow" );
  264.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  265.     AddFx( id, "fxBlow" );
  266. }
  267.  
  268. public Extra(id)
  269. {
  270.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  271.     AddFx( id, "fxBlow" );
  272.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
  273.     AddFx( id, "fxBlow" );
  274.     AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
  275.     AddFx( id, "fxSprite", "sprites/ywaves.spr", 6, 60, 0, 0, 0 );
  276.     AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 90, 250);
  277. }
  278.  
  279. public RemoveAll(id)
  280. {
  281.     // output just for testing. remove if no longer needed.
  282.     client_print(id, print_chat, "removeAll");
  283.    
  284.     RemFx( id, "fxLgtField");
  285.     RemFx( id, "fxPowerup");
  286. }
RAW Paste Data
Top