From 7e45230930763666506027e3feba89f9b9d59917 Mon Sep 17 00:00:00 2001 From: zaCade Date: Sat, 14 Jan 2023 15:26:05 +0100 Subject: [PATCH] [Break] Initial commit. --- Break/scripting/Break.sp | 220 ++++++++++++++++++++++++++++++ Break/scripting/include/Break.inc | 51 +++++++ 2 files changed, 271 insertions(+) create mode 100644 Break/scripting/Break.sp create mode 100644 Break/scripting/include/Break.inc diff --git a/Break/scripting/Break.sp b/Break/scripting/Break.sp new file mode 100644 index 00000000..59adde40 --- /dev/null +++ b/Break/scripting/Break.sp @@ -0,0 +1,220 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include +#include +#include + +/* INTS */ +int g_iBreak = 0; + +/* BOOLS */ +bool g_bBreak = false; + +/* HANDLES */ +Handle g_hBreak = null; + +/* FORWARDS */ +GlobalForward g_hFwd_OnBreakStarted = null; +GlobalForward g_hFwd_OnBreakFinished = null; +GlobalForward g_hFwd_OnBreakCancelled = null; + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public Plugin myinfo = +{ + name = "Break", + author = "zaCade", + description = "Allows for making breaks during events ect.", + version = "1.0.0" +}; + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int iErrorSize) +{ + CreateNative("Break_IsBreakActive", Native_IsBreakActive); + + RegPluginLibrary("Break"); + return APLRes_Success; +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public void OnPluginStart() +{ + g_hFwd_OnBreakStarted = new GlobalForward("Break_OnBreakStarted", ET_Ignore); + g_hFwd_OnBreakFinished = new GlobalForward("Break_OnBreakFinished", ET_Ignore); + g_hFwd_OnBreakCancelled = new GlobalForward("Break_OnBreakCancelled", ET_Ignore); + + RegAdminCmd("sm_break", Command_InitiateBreak, ADMFLAG_BAN); + RegAdminCmd("sm_cancelbreak", Command_CancelBreak, ADMFLAG_BAN); +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public Action Command_InitiateBreak(int iClient, int iArgs) +{ + if (iArgs < 1) + { + ReplyToCommand(iClient, "[SM] Usage: sm_break