Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- Handle SniperReload, AnimePlay;
- public OnPluginStart()
- {
- SniperReload = CreateConVar("sm_hunting_speed", "2.0", "", FCVAR_NONE);
- AnimePlay = CreateConVar("sm_anime", "2.0", "", FCVAR_NONE);
- HookEvent("weapon_reload", WeaponReload);
- AutoExecConfig(true, "Reload_For_Anime");
- }
- public Action:WeaponReload(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetEventInt(event, "userid");
- new iCurrentWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- float nextattack = GetEntPropFloat(client, Prop_Send, "m_flNextAttack");
- if(!IsValidEntity(iCurrentWeapon))
- return Plugin_Continue;
- decl String:weapon[32];
- GetEntityClassname(iCurrentWeapon, weapon, sizeof(weapon));
- if(StrEqual(weapon, "weapon_hunting_rifle"))
- {
- nextattack -= GetConVarFloat(SniperReload);
- SetEntPropFloat(client, Prop_Send, "m_flNextAttack", nextattack);
- SetEntPropFloat(iCurrentWeapon, Prop_Send, "m_flNextPrimaryAttack", nextattack);
- SetEntPropFloat(client, Prop_Send, "m_flPlaybackRate", GetConVarFloat(AnimePlay));
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement