Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <engine>
- #include <cstrike>
- new Models[ 2 ][ ] =
- {
- "models/v_bknuckles.mdl",
- "models/p_bknuckles.mdl"
- }
- public plugin_init( )
- {
- register_plugin( "Brass Knuckles (Short Version)", "1.0", "Rejack" );
- register_event( "CurWeapon", "evCurWeapon", "be", "1=1" );
- register_event( "Damage", "evDamage", "be", "2!0" );
- }
- public plugin_precache()
- {
- precache_model( Models[ 0 ] );
- precache_model( Models[ 1 ] );
- }
- public evDamage( client )
- {
- if ( !is_user_alive( client ) || !is_user_connected( client ) )
- return 0;
- new Weapon, Part;
- get_user_attacker( client, Weapon, Part );
- if ( Weapon != CSW_KNIFE )
- return 0;
- new Float:Random[ 3 ];
- for ( new i = 0; i < 3; i++ )
- Random[ i ] = random_float( 100.0, 150.0 );
- Punch( client, Random );
- return 0;
- }
- public evCurWeapon( client )
- {
- if ( !is_user_connected( client ) || !is_user_alive( client ) )
- return 1;
- new Trash[ 2 ], Weapon = get_user_weapon( client, Trash[ 0 ], Trash[ 1 ] );
- if ( Weapon == CSW_KNIFE )
- {
- entity_set_string( client, EV_SZ_viewmodel, Models[ 0 ] );
- entity_set_string( client, EV_SZ_weaponmodel, Models[ 1 ] );
- }
- return 0;
- }
- stock Punch( client, Float:ViewAngle[ 3 ] )
- entity_set_vector( client, EV_VEC_punchangle, ViewAngle )
Advertisement
Add Comment
Please, Sign In to add comment