Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxx/amxmodx>
- #include <fakemeta>
- #include <ipci/ascend>
- #include <ipci/Fxlib>
- #include <engine>
- #define MOD_SOUND 0
- #define MOD_CHARGE 0
- #define MOD_WEAPON 0
- new bool:tie[32];
- new CloudSphere;
- new bool:loop[32];
- // << Implement CX Interface >>
- #include <xtension/class/main>
- #include <xs>
- PluginInit ()
- {
- register_plugin("AdvMeleeMod", "1337", "BANDIT / C4 / Matias_Esf");
- register_message(get_user_msgid("MeleeTxtHud"), "MeleeText");
- register_message(get_user_msgid("MeleeTxtHud"), "AdvMeleeStates");
- // client commands just for testing. remove if no longer needed.
- //register_clcmd("fx", "NewFX");
- //register_clcmd("nofx", "RemoveFX");
- }
- PluginPreCache ()
- {
- precache_model( "sprites/stmbal1.spr" );
- precache_model( "sprites/white.spr" );
- precache_model( "sprites/ecx.lightning.spr" );
- precache_model( "sprites/lightning.spr" );
- precache_model( "sprites/ywaves.spr" );
- precache_model( "models/evolution/Auras/shape_C.mdl" );
- precache_model( "sprites/rcharge.spr" );
- precache_model( "sprites/ecx.cooler.spr" );
- precache_model( "sprites/ecx.lightning.spr" );
- precache_model( "sprites/onda.spr" );
- }
- public client_PostThink( Client )
- {
- if( pev( Client, pev_sequence ) == 126 )
- {
- client_cmd(Client, "say Adv Meele!");
- set_task(0.0,"Fastfight",Client);
- AddFx( Client, "fxPowerup", 0, 0, 0 );
- }
- if( pev( Client, pev_sequence ) == 127 )
- {
- client_cmd(Client, "say Adv Meele!");
- set_task(0.0,"Fastfight",Client);
- AddFx( Client, "fxPowerup", 0, 0, 0 );
- }
- else if
- {
- //RemFx( Client, "fxAvatar", 0);
- //RemFx( Client, "fxPowerup", 0);
- }
- }
- public Fastfight (Client)
- {
- if(loop)
- set_task(1.0,"Fastfight",Client);
- setClientANIMATION(Client,random_num(129,152) ,2.0)
- }
- public AdvMeleeStates(MsgID, dest, id)
- {
- client_print(id, print_chat, "MsgID: %d , dest: %d , args#: %d",MsgID, dest, get_msg_args());
- for(new i = 1; i <= get_msg_args(); i++)
- {
- client_print(id, print_chat, "arg%d: %d",i,get_msg_arg_int(i));
- }
- }
- // client command function just for testing. remove if no longer needed.
- public NewFX(id)
- {
- //client_print(id, print_console, "NewFX on id %d", id);
- set_task(1.0,"Effects",id);
- return 1;
- }
- // client command function just for testing. remove if no longer needed.
- public RemoveFX(id)
- {
- //client_print(id, print_console, "RemoveFX");
- set_task(1.0,"RemoveAll",id);
- return 1;
- }
- public MeleeText(MsgID, dest, id)
- {
- // output just for testing. remove if no longer needed.
- //client_print(id, print_chat, "variable: %d",get_msg_arg_int(1))
- if(get_msg_arg_int(1) == 11 ) // Blockbreaker
- {
- Rays(id);
- set_task(0.1,"Effects2",id);
- AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
- set_task(2.0,"RemoveAll",id);
- tie[id] = false;
- }
- else if(get_msg_arg_int(1) == 12 ) // Win
- {
- set_task(2.0,"RemoveAll",id);
- AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
- tie[id] = false;
- }
- else if(get_msg_arg_int(1) == 13 ) // Loser
- {
- set_task(2.0,"RemoveAll",id);
- tie[id] = false;
- }
- else if(get_msg_arg_int(1) == 14 ) // Tie
- {
- if(tie[id])
- {
- set_task(2.0,"RemoveAll",id);
- tie[id] = false;
- }
- else
- {
- Rays(id);
- set_task(0.1,"Effects2",id);
- AddFx( id, "fxScreenShake", 50.0, 5.0, 5.0 );
- AddFx( id, "fxBlow" );
- tie[id] = true;
- }
- }
- else if(get_msg_arg_int(1) == 15 ) // Headon
- {
- Rays(id);
- CloudSphereFX(id);
- set_task(0.1,"Effects",id);
- //set_task(4.8,"RemoveAll",id);
- AddFx( id, "fxScreenShake", 50.0, 5.0, 5.0 ); // Effects already got a screenshake!
- AddFx( id, "fxBlow" ); // Effects already got multiple blows!
- AddFx( id, "fxSprite", "sprites/onda.spr", 15, 200, 0, 0, 0 );
- }
- else if(get_msg_arg_int(1) == 16 ) // Powerhit
- {
- Rays(id);
- set_task(0.1,"Effects2",id);
- set_task(0.8,"RemoveAll",id);
- set_task(1.0,"RT",id);
- //remove_task(id)
- tie[id] = false;
- }
- }
- public RT(id)
- {
- remove_task(id)
- }
- public Rays(id)
- {
- static Float:Origin[3];
- entity_get_vector(id, EV_VEC_origin, Origin);
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- {
- write_byte(TE_BEAMENTPOINT);
- write_short(id | 0x1000);
- write_coord(floatround(Origin[0])+ random_num(-10, 10));
- write_coord(floatround(Origin[1])+ random_num(-10, 10));
- write_coord(floatround(Origin[2])+ random_num(-10, 10));
- write_short( engfunc( EngFunc_ModelIndex,"sprites/lgtning.spr" ) );
- write_byte(2); // Starting Frame
- write_byte(3); // Framerate
- write_byte(20); // Life
- write_byte(10); // Width
- write_byte(50); // Noise
- write_byte(255); // Red
- write_byte(255); // Green
- write_byte(255); // Blue
- write_byte(138); // Brightness
- write_byte(55); // Speed
- }
- message_end();
- }
- public CloudSphereFX( id )
- {
- new org[3];
- get_user_origin(id, org);
- for(new i; i < 30; i++)
- {
- message_begin( MSG_PVS, SVC_TEMPENTITY, org );
- {
- write_byte( TE_BEAMENTPOINT );
- write_short( id ); //start entity
- write_coord( org[0] + random_num(-200, 200)); //end position X
- write_coord( org[1] + random_num(-200, 200)); //end position Y
- write_coord( org[2] + random_num(-200, 200)); //end positon Z
- write_short( CloudSphere ); //set spr file
- write_byte( 3 ); //starting frame
- write_byte( 5 ); //frame rate in 0.1's
- write_byte( 90 ); //life in 0.1's
- write_byte( 255 ); //line width in 0.1's
- write_byte( 0 ); //noise amplitude in 0.01's
- write_byte( 10 ); //R
- write_byte( 10 ); //G
- write_byte( 10 ); //B
- write_byte( 250 ); //Brightness
- write_byte( 20 ); //scroll speed in 0.1's
- }
- message_end( );
- }
- }
- public Effects(id)
- {
- AddFx( id, "fxLgtField", 0.2, 3, 255, 100);
- AddFx( id, "fxWorldLight", 90, 255, 255, 255, 200.1, 0.5);
- AddFx( id, "fxPowerup", 0, 0, 0 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxScreenShake", 50.0, 3.0, 4.0 );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
- AddFx( id, "fxSprite", "sprites/ywaves.spr", 6, 60, 0, 0, 0 );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 90, 250);
- set_task(2.0,"Rays",id);
- set_task(2.0,"Extra",id);
- }
- public Effects2(id)
- {
- AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
- //AddFx( id, "fxPowerup", 0, 0, 0 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxScreenShake", 50.0, 3.0, 4.0 );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- }
- public Extra(id)
- {
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 30, 250 );
- AddFx( id, "fxBlow" );
- AddFx( id, "fxSprite", "sprites/ecx.cooler.spr", 180, 100, 0, 0, 0 );
- AddFx( id, "fxSprite", "sprites/ywaves.spr", 6, 60, 0, 0, 0 );
- AddFx( id, "fxPowerWave", "sprites/white.spr", 180, 145, 120, 90, 250);
- }
- public RemoveAll(id)
- {
- // output just for testing. remove if no longer needed.
- client_print(id, print_chat, "removeAll");
- RemFx( id, "fxLgtField");
- RemFx( id, "fxPowerup");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement