Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <fakemeta>
- #include <hamsandwich>
- #include <engine>
- #include <cstrike>
- new PLUGIN_NAME[] = "Brass Knuckles"
- new PLUGIN_VERSION[] = "1.0"
- new PLUGIN_AUTHOR[] = "Cheap_Suit"
- new bool:g_bknuckles[33]
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
- register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
- register_event("Damage", "Event_Damage", "be", "2!0")
- register_event("DeathMsg", "Event_Death", "a")
- RegisterHam( Ham_Spawn, "player", "PlayerSpawn", 1 );
- }
- public plugin_precache()
- {
- precache_model("models/DRknife/v_knife.mdl")
- }
- public client_connect(id) g_bknuckles[id] = false
- public Event_Death() g_bknuckles[read_data(2)] = false
- public PlayerSpawn(id)
- {
- g_bknuckles[id] = true
- }
- public Event_Damage(id)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return PLUGIN_CONTINUE
- new AttakerWeapon, AttakerPartHit
- new Attacker = get_user_attacker(id, AttakerWeapon, AttakerPartHit)
- if(AttakerWeapon != CSW_KNIFE)
- return PLUGIN_CONTINUE
- if(!g_bknuckles[Attacker])
- return PLUGIN_CONTINUE
- new Float:Random_Float[3]
- for(new i = 0; i < 3; i++) Random_Float[i] = random_float(100.0, 150.0)
- Punch_View(id, Random_Float)
- return PLUGIN_CONTINUE
- }
- public Event_CurWeapon(id)
- {
- if(!is_user_alive(id) || !is_user_connected(id))
- return PLUGIN_CONTINUE
- new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
- if(weapon == CSW_KNIFE)
- {
- if(g_bknuckles[id])
- {
- entity_set_string(id, EV_SZ_viewmodel, "models/DRknife/v_knife.mdl")
- }
- }
- return PLUGIN_CONTINUE
- }
- stock Punch_View(id, Float:ViewAngle[3])
- {
- entity_set_vector(id, EV_VEC_punchangle, ViewAngle)
- }
Add Comment
Please, Sign In to add comment