Guest User

Untitled

a guest
Sep 26th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.71 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <engine>
  5. #include <cstrike>
  6.  
  7. new PLUGIN_NAME[] = "Brass Knuckles"
  8. new PLUGIN_VERSION[] =  "1.0"
  9. new PLUGIN_AUTHOR[] =   "Cheap_Suit"
  10.  
  11. new bool:g_bknuckles[33]
  12. public plugin_init()
  13. {
  14.     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
  15.     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
  16.     register_event("Damage", "Event_Damage", "be", "2!0")
  17.     register_event("DeathMsg", "Event_Death", "a")
  18.    
  19.     RegisterHam( Ham_Spawn, "player", "PlayerSpawn", 1 );
  20. }
  21.  
  22. public plugin_precache()
  23. {
  24.     precache_model("models/DRknife/v_knife.mdl")
  25. }
  26.  
  27. public client_connect(id) g_bknuckles[id] = false
  28. public Event_Death() g_bknuckles[read_data(2)] = false
  29.  
  30. public PlayerSpawn(id)
  31. {
  32.     g_bknuckles[id] = true
  33. }
  34.  
  35. public Event_Damage(id)
  36. {
  37.     if(!is_user_alive(id) || !is_user_connected(id))
  38.         return PLUGIN_CONTINUE
  39.        
  40.     new AttakerWeapon, AttakerPartHit
  41.     new Attacker = get_user_attacker(id, AttakerWeapon, AttakerPartHit)
  42.    
  43.     if(AttakerWeapon != CSW_KNIFE)
  44.         return PLUGIN_CONTINUE
  45.    
  46.     if(!g_bknuckles[Attacker])
  47.         return PLUGIN_CONTINUE
  48.    
  49.     new Float:Random_Float[3]
  50.     for(new i = 0; i < 3; i++) Random_Float[i] = random_float(100.0, 150.0)
  51.     Punch_View(id, Random_Float)
  52.  
  53.     return PLUGIN_CONTINUE
  54. }
  55.  
  56. public Event_CurWeapon(id)
  57. {
  58.     if(!is_user_alive(id) || !is_user_connected(id))
  59.         return PLUGIN_CONTINUE
  60.        
  61.     new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
  62.     if(weapon == CSW_KNIFE)
  63.     {
  64.         if(g_bknuckles[id])
  65.         {
  66.             entity_set_string(id, EV_SZ_viewmodel, "models/DRknife/v_knife.mdl")
  67.         }
  68.     }
  69.     return PLUGIN_CONTINUE
  70. }
  71.  
  72.  
  73. stock Punch_View(id, Float:ViewAngle[3])
  74. {
  75.     entity_set_vector(id, EV_VEC_punchangle, ViewAngle)
  76. }
Add Comment
Please, Sign In to add comment