Advertisement
FlacoBey

Untitled

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