FlacoBey

Untitled

Jun 1st, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. #pragma semicolon 1
  5. #pragma newdecls required
  6.  
  7. public void OnPluginStart()
  8. {
  9.     HookEvent("weapon_reload", Event_ReloadStart);
  10. }
  11.  
  12. public Action Event_ReloadStart(Handle event, const char[] name, bool dontBroadcast)
  13. {
  14.     int userid = GetEventInt(event, "userid");
  15.     int client = GetClientOfUserId(userid);
  16.     int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  17.     char classname[256];
  18.     GetEntityClassname(weapon, classname, sizeof(classname));
  19.     if(StrContains(classname, "sg552", false) > -1)
  20.     {
  21.         float nextattack;
  22.         nextattack = GetEntPropFloat(client, Prop_Send, "m_flNextAttack");
  23.         nextattack -= 0.6;
  24.         SetEntPropFloat(client, Prop_Send, "m_flNextAttack", nextattack);
  25.         SetEntPropFloat(weapon, Prop_Send, "m_flNextPrimaryAttack", nextattack);
  26.     }  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment