Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4. #include <colorvariables>
  5.  
  6. #pragma newdecls required
  7. #pragma semicolon 1
  8.  
  9. public Plugin myinfo =
  10. {
  11. name = "widok hp",
  12. author = "katujemy.eu",
  13. description = "Pokazuje kogo atakujesz, ile zostało tej osobie hp",
  14. version = "1.1",
  15. url = "katujemy.eu"
  16. };
  17.  
  18. public void OnPluginStart()
  19. {
  20. HookEvent("player_hurt", event_PlayerHurt, EventHookMode_Post);
  21. }
  22.  
  23. public Action event_PlayerHurt(Handle event, const char[] name, bool dontBroadcast)
  24. {
  25. int userid = GetEventInt(event, "userid");
  26. int client = GetClientOfUserId(userid);
  27.  
  28. if(client > 0 && IsClientConnected(client) && IsClientInGame(client))
  29. {
  30.  
  31. int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  32.  
  33. if(IsPlayerVIP(attacker)==true)
  34. {
  35. if(attacker > 0 && IsClientConnected(attacker) && IsClientInGame(attacker))
  36. {
  37. {
  38. int i_health = GetEventInt(event, "health");
  39.  
  40. char text[100];
  41. if(IsValidPlayer(attacker) && GetClientTeam(attacker) == CS_TEAM_CT)
  42. {
  43. Format(text, 100, "%N | %i HP", client, i_health);
  44. SetHudTextParams(0.2, 0.8, 3.0, 0, 215, 255, 255, 0, 0.25, 0.5, 0.5);
  45. ShowHudText(attacker, 2, text);
  46. }
  47. }
  48. }
  49. }
  50. }
  51. }
  52.  
  53. stock bool IsPlayerVIP(int client)
  54. {
  55. if(GetUserFlagBits(client) & ADMFLAG_CUSTOM2)
  56. return true;
  57. return false;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement