-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAeroControler_WARSytem.sp
118 lines (98 loc) · 3.46 KB
/
AeroControler_WARSytem.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#pragma semicolon 1
/*
**
** Aero Jail Controler Plugin
** WAR Base Control System
** Author: _AeonOne_
**
** binding license: GPLv3
** voluntary license:
** "THE BEER-WARE LICENSE" (Revision 43-1 by Julien Kluge):
** Julien Kluge wrote this file. As long as you retain this notice you
** can do what is defined in the binding license (GPLv3). If we meet some day, and you think
** this stuff is worth it, you can buy me a beer, pizza or something else which you think is appropriate.
** This license is a voluntary license. You don't have to observe it.
**
*/
#define DEBUG
/* γ = dev : α = canditae for control testing : β = proving ground/release candidate : λ = Final stable/RTM */
#define PLUGIN_VERSION "1.03λ"
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
typeset WarStart
{
function void ();
function void (int index);
function void (int index, int maxrounds, int maxtime);
};
typeset WarEnd
{
function void ();
function void (int index);
};
typedef WarFreezeTimeStart = function void (int time);
typedef WarFreezeTimeEnd = function void ();
#include "AeroControler\\aerocontroler_core_interface.inc" //interface to the core
#include "AeroControler\\SharedPluginBase\\AC_SharedPluginBase.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_Vars.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_Stocks.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_HandlerCallbacks.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_Events.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_Cmds.inc"
#include "AeroControler\\War_Sys\\Controler\\AC_WAR_Configs.inc"
public Plugin myinfo =
{
name = "Aero Controler - Extension: WAR Base Control System",
author = "_AeonOne_",
description = "Controls the basic functions in a war.",
version = PLUGIN_VERSION,
url = "[email protected]"
};
public void OnPluginStart()
{
DetectGameMod();
LoadStaticConfig();
LoadTranslationFiles();
ac_getCoreComTag(Tag, sizeof(Tag));
ExtensionEntryIndex = ac_registerPluginExtension("Aero WAR Base Control System", "_AeonOne_", PLUGIN_VERSION);
ac_registerCMDMenuBuildForward(view_as<buildCMDMenuForward>AddWarCmdToCmdMenu);
if (Alw_warVoteCmd) { RegMultipleConsoleCmd(Str_WarVoteCmd, Cmd_VoteWar, "Vote for a war"); }
RegAdminCmd("sm_forcewarvote", ACmd_ForceWarMenu, ADMFLAG_CHEATS, "sm_forcewarvote [#userid|name]");
RegAdminCmd("sm_stopwar", ACmd_StopWar, ADMFLAG_CHEATS, "sm_stopwar");
HookEvent("round_end", Event_RoundEnd, EventHookMode_Post);
HookEvent("round_start", Event_RoundStart, EventHookMode_Post);
HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
}
public void OnPluginEnd()
{
if (LibraryExists("ac_core")) //alibi check
{
ac_unregisterPluginExtension(ExtensionEntryIndex);
}
}
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, err_max)
{
CreateNative("ac_war_RegWar", view_as<NativeCall>AC_Native_RegWar);
CreateNative("ac_war_UnRegWar", view_as<NativeCall>AC_Native_UnRegWar);
CreateNative("ac_war_EndWar", view_as<NativeCall>AC_Native_EndWar);
RegPluginLibrary("ac_war_sys");
return APLRes_Success;
}
public void OnMapStart()
{
g_Offset_CollisionGroup = FindSendPropOffs("CBaseEntity", "m_CollisionGroup");
}
public void ac_OnCoreComTagChanged(const char[] tag)
{
Format(Tag, sizeof(Tag), "%s", tag);
}
public void OnClientPutInServer(client)
{
SDKHook(client, SDKHook_OnTakeDamage, SDKH_OnTakeDamage);
}
public void OnClientDisconnect_Post(client)
{
HasVotedWar[client] = false;
}