Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #pragma semicolon 1
- #define WEAPON_LENGTH 32
- new bool:EnableSapperDestroy = true;
- public Plugin:myinfo =
- {
- name = "Stealth Sapper",
- author = "Rorschach",
- description = "prevents buildings destroyed by sappers from being reported.",
- version = "1.0",
- }
- public OnPluginStart()
- {
- RegAdminCmd("spy_ss", Command_ObjectDestroyed, ADMFLAG_SLAY, "Stealth Sapper Initiated");
- HookEvent("object_destroyed", Event_ObjectDestroyed, EventHookMode_Pre);
- PrintToServer("Stealth Sapper Toggled On (%b)", EnableSapperDestroy);
- }
- public Action:Command_ObjectDestroyed(client, args)
- {
- EnabledSapperDestroy = !EnableSapperDestroy;
- PrintToServer("Stealth Sapper Toggled Off (%b)", EnableSapperDestroy);
- return Plugin_Handled;
- }
- public Action:Event_ObjectDestroyed(Handle:event, const String:name[], bool:dontBroadcast)
- {
- if (!DisableSapperDestroy) return Plugin_Continue;
- decl String:weapon[WEAPON_LENGTH];
- GetEventString(event, "weapon", weapon, sizeof(weapon));
- if (StrEqual(weapon, "obj_attachment_sapper"))
- {
- return Plugin_Stop;
- }
- GetEventInt(event, "attacker")
- new attackerUserID = GetEventInt(event, "attacker");
- new attackerClient = GetClientOfUserId(attackerUserID);
- decl String:attacker[MAX_NAME_LENGTH];
- GetClientName(attackerClient, attacker, sizeof(attacker);
- new amount - GetAmount();
- if (amount <5)
- {
- PrintToServer("%s stealth sapped %s's %s" , attacker , victim, building);
- PrintToChat(attacker, "You stealth sapped %s's %s", victim, building);
- PrintToChat(victim, "%s stealth sapped your %s", attacker, building);
- }
- return Plugin_Continue;
- }
Add Comment
Please, Sign In to add comment