Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4. #include <sdkhooks>
  5.  
  6. char Killer[MAXPLAYERS + 1];
  7. bool usedcmd[MAXPLAYERS + 1];
  8. bool clientiskiller[MAXPLAYERS + 1];
  9. EngineVersion g_Game;
  10.  
  11. public Plugin myinfo =
  12. {
  13. name = "FK Reporter",
  14. author = "Stylish",
  15. description = "",
  16. version = "1.0",
  17. url = ""
  18. };
  19.  
  20. public void OnPluginStart()
  21. {
  22. g_Game = GetEngineVersion();
  23. if (g_Game != Engine_CSGO && g_Game != Engine_CSS)
  24. {
  25. SetFailState("This plugin is for CSGO/CSS only.");
  26. }
  27. RegAdminCmd("sm_fk", Command_reportfk, 0);
  28. HookEvent("player_death", player_death);
  29. }
  30.  
  31. public Action Command_reportfk(int client, int args)
  32. {
  33. if (IsClientInGame(client))
  34. {
  35. for (int i = 1; i <= MaxClients; i++)
  36. {
  37. if (IsClientInGame(i) && CheckCommandAccess(i, "", ADMFLAG_GENERIC) && !clientiskiller[client])
  38. {
  39. PrintToChat(i, "\x01[\x04BVGames RP\x01]\x04%N \x10reported \x04%s \x10for freekilling him.", client, Killer[client]);
  40. usedcmd[client] = true;
  41. }
  42. }
  43. }
  44. return Plugin_Handled;
  45. }
  46. public Action player_death(Event event, char[] name, bool dontBroadcast)
  47. {
  48. char KillerName[MAX_NAME_LENGTH];
  49. int client, attacker;
  50. client = GetClientOfUserId(event.GetInt("userid"));
  51. attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  52. if (client == attacker)
  53. {
  54. clientiskiller[client] = true;
  55. }
  56. GetClientName(attacker, KillerName, MAX_NAME_LENGTH);
  57. Format(Killer[client], MAX_NAME_LENGTH, KillerName);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement