Advertisement
FlacoBey

Untitled

Jun 10th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include <sdktools>
  2. #include <sdkhooks>
  3.  
  4. #pragma newdecls required
  5. #pragma semicolon 1
  6.  
  7. public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
  8. {
  9.     int iCurrentWeapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
  10.    
  11.     if(!IsValidEntity(iCurrentWeapon))
  12.         return Plugin_Continue;
  13.    
  14.     int iClip = GetEntProp(iCurrentWeapon, Prop_Send, "m_iClip1");
  15.     int iViewModel = GetEntPropEnt(client, Prop_Send, "m_hViewModel");
  16.    
  17.     if(iClip == 5 && buttons & IN_RELOAD)
  18.     {
  19.         SetEntProp(iViewModel, Prop_Send, "m_nLayerSequence", 2);
  20.         SetEntPropFloat(iViewModel, Prop_Send, "m_flLayerStartTime", GetGameTime());
  21.         ChangeEdictState(iViewModel, FindDataMapInfo(iViewModel, "m_nLayerSequence"));
  22.     }
  23.     return Plugin_Continue;
  24. }
  25.  
  26. stock bool IsValidClient(int iClient)
  27. {
  28.     if(iClient < 1 || iClient > MaxClients)
  29.     return false;
  30.  
  31.     return IsClientInGame(iClient);
  32. }
  33.  
  34. stock bool bIsSurvivor(int client)
  35. {
  36.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement