FlacoBey

Untitled

May 23rd, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include sdkhooks
  4.  
  5. public OnClientPutInServer(client)
  6. {
  7.     SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  8. }
  9.  
  10. public OnClientDisconnect(client)
  11. {
  12.     SDKUnhook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  13. }
  14.  
  15. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)  
  16. {
  17.     if(IsValidClient(victim) && damagetype & DMG_BLAST)
  18.     {
  19.         damage = 0.0
  20.         return Plugin_Changed;
  21.     }
  22.     return Plugin_Continue;
  23. }
  24.  
  25. stock bool IsValidClient(int client)
  26. {
  27.     if ( client < 1 || client > MaxClients ) return false;
  28.     if( !IsClientInGame(client)) return false;
  29.     if ( !IsPlayerAlive( client )) return false;
  30.     if(GetClientTeam(client) != 3) return false;
  31.     return true;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment