Guest User

Untitled

a guest
Apr 26th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #include <sourcemod>
  2.  
  3. #pragma semicolon 1
  4.  
  5. #define WEAPON_LENGTH 32
  6.  
  7. new bool:EnableStealthAssassin = true;
  8.  
  9. public Plugin:myinfo =
  10. {
  11. name = "Stealth Assassin",
  12. author = "Rorschach",
  13. description = "Blocks vicims of backstabs from being reported.",
  14. version = "1.0",
  15. }
  16.  
  17. public OnPluginStart()
  18. {
  19. RegAdminCmd("spy_sa", Command_PlayerDeath, ADMFLAG_SLAY, "Stealth Assassin Initiated");
  20. HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
  21. PrintToChatAll("Stealth Assassin Loaded: EnableStealthAssassin? %b", EnableStealthAssassin);
  22. }
  23.  
  24. public Action:Command_PlayerDeath(client, args)
  25. {
  26. EnableStealthAssassin = !EnableStealthAssassin;
  27. PrintToChatAll("Stealth Assassin Command: EnableStealthAssassin? %b", EnableStealthAssassin);
  28. return Plugin_Handled;
  29. }
  30.  
  31. public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  32. {
  33. if (!EnableStealthAssassin)
  34. return Plugin_Continue;
  35.  
  36. decl String:weapon[WEAPON_LENGTH];
  37. GetEventString(event, "weapon", weapon, sizeof(weapon));
  38.  
  39. PrintToChatAll("Stealth Assassin: EnableStealthAssassin? %b Weapon? %s", EnableStealthAssassin, weapon);
  40.  
  41. if (StrEqual(weapon, "knife"))
  42. return Plugin_Stop;
  43.  
  44. return Plugin_Continue;
  45. }
Add Comment
Please, Sign In to add comment