daily pastebin goal
19%
SHARE
TWEET

Untitled

FlacoBey Jan 16th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <sourcemod>
  2.  
  3. Handle SniperReload, AnimePlay;
  4.  
  5. public OnPluginStart()
  6. {
  7.     SniperReload = CreateConVar("sm_hunting_speed", "2.0", "", FCVAR_NONE);
  8.     AnimePlay = CreateConVar("sm_anime", "2.0", "", FCVAR_NONE);
  9.     HookEvent("weapon_reload", WeaponReload);
  10.     AutoExecConfig(true, "Reload_For_Anime");
  11. }
  12.  
  13. public Action:WeaponReload(Handle:event, const String:name[], bool:dontBroadcast)
  14. {
  15.     new client = GetEventInt(event, "userid");
  16.    
  17.     new iCurrentWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  18.     float nextattack = GetEntPropFloat(client, Prop_Send, "m_flNextAttack");
  19.    
  20.     if(!IsValidEntity(iCurrentWeapon))
  21.     return Plugin_Continue;
  22.    
  23.     decl String:weapon[32];
  24.     GetEntityClassname(iCurrentWeapon, weapon, sizeof(weapon));
  25.    
  26.     if(StrEqual(weapon, "weapon_hunting_rifle"))
  27.     {
  28.         nextattack -= GetConVarFloat(SniperReload);
  29.         SetEntPropFloat(client, Prop_Send, "m_flNextAttack", nextattack);
  30.         SetEntPropFloat(iCurrentWeapon, Prop_Send, "m_flNextPrimaryAttack", nextattack);
  31.         SetEntPropFloat(client, Prop_Send, "m_flPlaybackRate", GetConVarFloat(AnimePlay));
  32.     }
  33.    
  34.     return Plugin_Continue;
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top