Skip to content

Commit 3963193

Browse files
committed
Use raw register plugin native instead utils
1 parent ad241f6 commit 3963193

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

amxmodx/scripting/CustomWeaponsAPI.sma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PluginInit() {
3030

3131
Dbg_PrintServer("%s run in debug mode.", PluginName);
3232

33-
RegisterPluginByVars();
33+
register_plugin(PluginName, PluginVersion, PluginAuthor);
3434
register_library(CWAPI_LIBRARY);
3535
CreateConstCvar(CWAPI_VERSION_CVAR, CWAPI_VERSION);
3636

amxmodx/scripting/Cwapi/Utils.inc

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -106,37 +106,6 @@ stock ShowWeaponListHud(const UserId, const ItemId) {
106106
message_end();
107107
}
108108

109-
// https://github.com/Nord1cWarr1or/Universal-AFK-Manager/blob/6272afbb8c27f8b7ad770e3036b5960042001e6b/scripting/UAFKManager.sma#L298-L321
110-
stock GetAmxxVersionNum() {
111-
static iRes;
112-
if (iRes) {
113-
return iRes;
114-
}
115-
116-
new sAmxxVer[16];
117-
get_amxx_verstring(sAmxxVer, charsmax(sAmxxVer));
118-
119-
if (strfind(sAmxxVer, "1.10.0") != -1) {
120-
iRes = 1100;
121-
} else if (strfind(sAmxxVer, "1.9.0") != -1) {
122-
iRes = 190;
123-
} else if (strfind(sAmxxVer, "1.8.3") != -1) {
124-
iRes = 183;
125-
} else if (strfind(sAmxxVer, "1.8.2") != -1) {
126-
iRes = 182;
127-
} else {
128-
iRes = 1;
129-
}
130-
131-
return iRes;
132-
}
133-
134-
#define RegisterPluginByVars() CompositeMacros( \
135-
if (GetAmxxVersionNum() < 1100) { \
136-
register_plugin(PluginName, PluginVersion, PluginAuthor); \
137-
} \
138-
)
139-
140109
stock CreateConstCvar(const sCvarName[], const sCvarValue[]) {
141110
set_pcvar_string(create_cvar(sCvarName, sCvarValue, FCVAR_SERVER), sCvarValue);
142111
}
@@ -194,6 +163,7 @@ stock WeaponIdType:GetWeaponIdByName(const sWeaponName[]) {
194163

195164
#define ThrowError(%1) CompositeMacros( \
196165
log_error(0, %1); \
166+
abort(0, %1); \
197167
log_amx(%1); \
198168
)
199169

0 commit comments

Comments
 (0)