Advertisement
FlacoBey

Untitled

Jun 10th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 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.    
  16.     if(iClip == 5 && buttons & IN_RELOAD)
  17.     {
  18.         buttons &= ~IN_ATTACK2;
  19.         return Plugin_Handled;
  20.     }
  21.     return Plugin_Continue;
  22. }
  23.  
  24. stock bool IsValidClient(int iClient)
  25. {
  26.     if(iClient < 1 || iClient > MaxClients)
  27.     return false;
  28.  
  29.     return IsClientInGame(iClient);
  30. }
  31.  
  32. stock bool bIsSurvivor(int client)
  33. {
  34.     return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement