Участник
Пользователь
- Сообщения
- 51
- Реакции
- 6
- Ошибка
-
меню причин для наказания пуст
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5402 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jun 24 2020 13:50:39
Built from: https://github.com/alliedmodders/amxmodx/commit/b261180
Build ID: 5402:b261180
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.698-dev
Build date: 10:14:22 Aug 19 2020 (2321)
Build from: https://github.com/dreamstalker/rehlds/commit/376bc15
- ReGamedll
-
ReGameDLL version: 5.18.0.474-dev
Build date: 11:07:34 Jul 16 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/efb06a7
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion.so v0.1.0.92 ini Start Never
[ 2] Revoice RUN - revoice.so v0.1.0.32 ini Start Never
[ 3] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5402 ini Start ANY
[ 7] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[ 8] ReAPI RUN - reapi_amxx_i386.so v5.15.0.197-dev pl6 ANY Never
[ 9] gRIP RUN - grip_amxx_i386.so v0.1.5 Beta pl6 ANY ANY
[10] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl6 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[13] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
[16] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl6 ANY ANY
16 plugins, 16 running
- Список плагинов
-
Currently loaded plugins:
id name version author url file status
[ 1] 0 FreshBans 1.4.3b kanagava unknown fresh_bans_ running
[ 2] 1 ReAimDetector API 0.2.2 ReHLDS Team unknown reaimdetect running
[ 3] 2 Admin Base 1.9.0.5271 AMXX Dev Team unknown admin.amxx running
[ 4] 3 Admin Commands 1.9.0.5271 AMXX Dev Team unknown admincmd.am running
[ 5] 4 Map Manager: GUI 0.0.4 Mistrick unknown map_manager running
[ 6] 5 Menus Front-End 1.5 neugomon unknown menufront_e running
[ 7] 6 Commands Menu 1.9.0.5271 AMXX Dev Team unknown cmdmenu.amx running
[ 8] 7 Players Menu 1.7 neugomon unknown players_men running
[ 9] 8 Maps Menu 1.9.0.5271 AMXX Dev Team unknown mapsmenu.am running
[ 10] 9 Plugin Menu 1.9.0.5271 AMXX Dev Team unknown pluginmenu. running
[ 11] 10 Admin Chat 1.9.0.5271 AMXX Dev Team unknown adminchat.a running
[ 12] 11 Admin Votes 1.9.0.5271 AMXX Dev Team unknown adminvote.a running
[ 13] 12 Pause Plugins 1.9.0.5271 AMXX Dev Team unknown pausecfg.am running
[ 14] 13 Stats Configuration 1.9.0.5271 AMXX Dev Team unknown statscfg.am running
[ 15] 14 AES: StatsX 0.5.9 [REA serfreeman1337/s unknown aes_statsx_ running
[ 16] 15 StatsX 1.9.0.5271 AMXX Dev Team unknown statsx.amxx running
[ 17] 16 Parachute Lite [ReAPI] 11.0 Leo_[BH] unknown parachute.a running
[ 18] 17 Knife Duel with Telepo 1.2 neygomon unknown duel.amxx running
[ 19] 18 CSStatsX SQL 0.7.4+2 serfreeman1337 unknown csstatsx_sq running
[ 20] 19 Stop the Bastards 1.7.0 F@nt0M unknown stop_the_ba running
[ 21] 20 Team Select 1.6.0 F@nt0M unknown teamselect. running
[ 22] 21 Plugin 1.0 Nunfy unknown nadpis.amxx running
[ 23] 22 V.I.P Environment 2.1.1 Vaqtincha unknown vip_environ running
[ 24] 23 FreeAmmoEveryRound 0.1 SHLAKBAUM unknown freeammoeve running
[ 25] 24 Reset Score ReFreshed 0.0.1 wopox1337@Dev-CS unknown rs.amxx running
[ 26] 25 PF-Editor 0.0.8 wellasgood unknown PluginsFile running
[ 27] 26 Killer ScreenFade 0.0.5 Vaqtincha unknown reapi_kille running
[ 28] 27 Damager 0.0.5 steelzzz unknown damager.amx running
[ 29] 28 Reklama 20.05.2020 mx?! unknown reklama.amx running
[ 30] 29 [ReAPI] No Team Flash 0.0.3 Vaqtincha unknown no_team_fla running
[ 31] 30 Advanced Gag 1.9.0 neygomon unknown amx_gag.amx running
[ 32] 31 AFK Control ReNew 1.2(a) neygomon unknown afk_control running
[ 33] 32 Welcome_Music 1.7 ExE unknown welcome_mus running
[ 34] 33 Mode 2x2 2.5re s1lent unknown mode.amxx running
[ 35] 34 [ReAPI] Knife Round 1.3 pUzzlik unknown re_knife_ro running
[ 36] 35 Menu System 0.1.2 serfreeman1337 unknown menuSystem. running
[ 37] 36 Advanced Experience Sy 0.5.9 [REA serfreeman1337/s unknown aes_main.am running
[ 38] 37 AES: CStrike Addon 0.5.9 [REA serfreeman1337/s unknown aes_exp_cst running
[ 39] 38 AES: Informer 0.5 Vega serfreeman1337 unknown aes_informe running
[ 40] 39 GM-X Core 0.1.86-alp GM-X Team unknown gmx.amxx running
[ 41] 40 GM-X Cache 0.1.67 GM-X Team unknown gmx_cache.a running
[ 42] 41 GM-X Access 0.1.67 GM-X Team unknown gmx_access. running
[ 43] 42 [APS] Core 0.1.84-alp GM-X Team unknown aps_core.am running
[ 44] 43 [APS] Players Menu 0.1.84-alp GM-X Team unknown aps_plmenu. running
[ 45] 44 [APS] Log 0.1.0-manu GM-X Team unknown aps_log.amx running
[ 46] 45 [APS] Ban 0.1.0-manu GM-X Team unknown aps_ban.amx running
[ 47] 46 [APS] Voice Chat 0.1.0-manu GM-X Team unknown aps_voice_c running
[ 48] 47 [APS] Text Chat 0.1.0-manu GM-X Team unknown aps_text_ch running
[ 49] 48 [APS] Mixed 0.1.0-manu GM-X Team unknown aps_mixed.a running
[ 50] 49 [APS] Chat Voice ReAPI 0.1.0-manu GM-X Team unknown aps_chat_vo running
[ 51] 50 [APS] Chat CM Addon 0.1.0-manu GM-X Team unknown aps_chat_te running
[ 52] 51 Map Manager: Core 3.0.7 Mistrick unknown map_manager running
[ 53] 52 Map Manager: Scheduler 0.1.5 Mistrick unknown map_manager running
[ 54] 53 Map Manager: Rtv 0.1.1 Mistrick unknown map_manager running
[ 55] 54 Map Manager: Nominatio 0.1.2 Mistrick unknown map_manager running
[ 56] 55 Map Manager: BlockList 0.0.3 Mistrick unknown map_manager running
[ 57] 56 Map Manager: Online so 0.0.2 Mistrick unknown map_manager running
[ 58] 57 Map Manager: Effects 0.0.9 Mistrick unknown map_manager running
[ 59] 58 Map Manager: Informer 0.0.5 Mistrick unknown map_manager running
[ 60] 59 Block Slash Symbol 13.10.2018 w0w unknown block_slash running
[ 61] 60 [UAC] Core 0.1.0-manu GM-X Team unknown uac_core.am running
[ 62] 61 [UAC] GM-X Loader 0.1.0-manu GM-X Team unknown uac_gmx_loa running
[ 63] 62 [UAC] AmxBans Loader 0.1.0-manu F@nt0M unknown uac_amxbans running
[ 64] 63 [UAC] Logger 0.1.0-manu GM-X Team unknown uac_logger. running
[ 65] 64 [UAC] Commands 0.1.0-manu GM-X Team unknown uac_command running
[ 66] 65 Custom Player Models A 0.2.1 F@nt0M & BlackSi unknown custom_play running
[ 67] 66 Custom Player Models C 0.2.1 BlackSignature unknown custom_play running
[ 68] 67 Custom Player Models T 0.2.1 BlackSignature unknown custom_play running
68 plugins, 68 running
- Автор плагина
- GM-X Team
- Версия плагина
- 0.1.84-alpha
- Исходный код
-
#include <amxmodx>
#include <amxmisc>
#include <grip>
#include <aps>
#include <gmx_stocks>
#define CHECK_NATIVE_TYPE(%1,%2) \
if (0 > %1 || %1 >= TypesNum) { \
return %2; \
}
#define CHECK_NATIVE_TYPE_ERROR(%1,%2) \
if (0 > %1 || %1 >= TypesNum) { \
log_error(AMX_ERR_NATIVE, "Invalid type %d", %1); \
return %2; \
}
enum {
FWD_PlayerPunishing,
FWD_PlayerPunished,
FWD_PlayerAmnestying,
FWD_PlayerAmnestied,
FWD_PlayerChecking,
FWD_PlayerChecked,
FWD_LAST
}
new Forwards[FWD_LAST], FwdReturn;
new Array:Types, TypesNum;
enum _:PunishmentStruc {
PunishmentID,
PunishmentType,
PunishmentExtra,
PunishmentCreated,
PunishmentTime,
PunishmentExpired,
PunishmentReason[APS_MAX_REASON_LENGTH],
PunishmentDetails[APS_MAX_DETAILS_LENGTH],
APS_PunisherType:PunishmentPunisherType,
PunishmentPunisherID,
APS_PunishmentStatus:PunishmentStatus
};
new Punishment[PunishmentStruc];
new Array:PlayersPunishment[MAX_PLAYERS + 1];
new PluginId;
public plugin_init() {
PluginId = register_plugin("[APS] Core", APS_VERSION_STR, "GM-X Team");
Types = ArrayCreate(APS_MAX_TYPE_LENGTH, 0);
for (new i = 1; i <= MAX_PLAYERS; i++) {
PlayersPunishment[i] = ArrayCreate(PunishmentStruc, 0);
}
Forwards[FWD_PlayerPunishing] = CreateMultiForward("APS_PlayerPunishing", ET_STOP, FP_CELL, FP_CELL);
Forwards[FWD_PlayerPunished] = CreateMultiForward("APS_PlayerPunished", ET_IGNORE, FP_CELL, FP_CELL);
Forwards[FWD_PlayerAmnestying] = CreateMultiForward("APS_PlayerAmnestying", ET_STOP, FP_CELL, FP_CELL);
Forwards[FWD_PlayerAmnestied] = CreateMultiForward("APS_PlayerAmnestied", ET_IGNORE, FP_CELL, FP_CELL);
Forwards[FWD_PlayerChecking] = CreateMultiForward("APS_PlayerChecking", ET_STOP, FP_CELL);
Forwards[FWD_PlayerChecked] = CreateMultiForward("APS_PlayerChecked", ET_IGNORE, FP_CELL);
}
public plugin_cfg() {
checkAPIVersion();
new fwdIniting = CreateMultiForward("APS_Initing", ET_IGNORE);
new fwdInited = CreateMultiForward("APS_Inited", ET_IGNORE);
ExecuteForward(fwdIniting, FwdReturn);
TypesNum = ArraySize(Types);
ExecuteForward(fwdInited, FwdReturn);
DestroyForward(fwdIniting);
DestroyForward(fwdInited);
}
public plugin_end() {
ArrayDestroy(Types);
for (new i = 1; i <= MAX_PLAYERS; i++) {
ArrayDestroy(PlayersPunishment[i]);
}
for (new i = 0; i < sizeof Forwards; i++) {
DestroyForward(Forwards[i]);
}
}
public client_connect(id) {
ArrayClear(PlayersPunishment[id]);
}
public client_disconnected(id) {
remove_task(id);
}
public GMX_PlayerLoaded(const id, GripJSONValue:data) {
ArrayClear(PlayersPunishment[id]);
ExecuteForward(Forwards[FWD_PlayerChecking], FwdReturn, id);
if (FwdReturn == PLUGIN_HANDLED) {
return;
}
new GripJSONValue:punishments = grip_json_object_get_value(data, "punishments");
if (punishments == Invalid_GripJSONValue) {
return;
}
new bool:hasPunishments = false;
for (new i = 0, n = grip_json_array_get_count(punishments), GripJSONValue:tmp; i < n; i++) {
tmp = grip_json_array_get_value(punishments, i);
if (grip_json_get_type(tmp) == GripJSONObject) {
parsePunishment(tmp);
ArrayPushArray(PlayersPunishment[id], Punishment, sizeof Punishment);
ExecuteForward(Forwards[FWD_PlayerPunished], FwdReturn, id, Punishment[PunishmentType]);
hasPunishments = true;
}
grip_destroy_json_value(tmp);
}
grip_destroy_json_value(punishments);
ExecuteForward(Forwards[FWD_PlayerChecked], FwdReturn, id);
if (hasPunishments) {
set_task_ex(1.0, "TaskCheckPlayer", id + 100, .flags = SetTask_Repeat);
}
}
public OnPunished(const GmxResponseStatus:status, GripJSONValue:data, const userid) {
if (status != GmxResponseStatusOk) {
return;
}
new id = GMX_GetPlayerByUserID(userid);
if (!id) {
return;
}
if (grip_json_get_type(data) != GripJSONObject) {
return;
}
new GripJSONValue:tmp = grip_json_object_get_value(data, "punishment");
parsePunishment(tmp);
grip_destroy_json_value(tmp);
ArrayPushArray(PlayersPunishment[id], Punishment, sizeof Punishment);
ExecuteForward(Forwards[FWD_PlayerPunished], FwdReturn, id, Punishment[PunishmentType]);
if (!task_exists(id + 100)) {
set_task_ex(1.0, "TaskCheckPlayer", id + 100, .flags = SetTask_Repeat);
}
}
public OnAmnestied(const GmxResponseStatus:status, GripJSONValue:data, const userid) {
if (status != GmxResponseStatusOk) {
return;
}
new id = GMX_GetPlayerByUserID(userid);
if (!id) {
return;
}
if (grip_json_get_type(data) != GripJSONObject) {
return;
}
new GripJSONValue:tmp = grip_json_object_get_value(data, "punishment");
new punishmentID = grip_json_object_get_number(tmp, "id");
grip_destroy_json_value(tmp);
for (new i = 0, n = ArraySize(PlayersPunishment[id]); i < n; i++) {
ArrayGetArray(PlayersPunishment[id], i, Punishment, sizeof Punishment);
if (Punishment[PunishmentStatus] != APS_PunishmentStatusActive) {
continue;
}
if (Punishment[PunishmentID] != punishmentID) {
continue;
}
ExecuteForward(Forwards[FWD_PlayerAmnestying], FwdReturn, id, Punishment[PunishmentType]);
if (FwdReturn != PLUGIN_HANDLED) {
Punishment[PunishmentStatus] = APS_PunishmentStatusAmnestied;
ArraySetArray(PlayersPunishment[id], i, Punishment, sizeof Punishment);
ExecuteForward(Forwards[FWD_PlayerAmnestied], FwdReturn, id, Punishment[PunishmentType]);
}
}
}
public TaskCheckPlayer(id) {
id -= 100;
if (!is_user_connected(id)) {
return;
}
new now = get_systime() + GMX_GetServerTimeDiff(), active = 0;
for (new i = 0, n = ArraySize(PlayersPunishment[id]); i < n; i++) {
ArrayGetArray(PlayersPunishment[id], i, Punishment, sizeof Punishment);
if (Punishment[PunishmentStatus] != APS_PunishmentStatusActive) {
continue;
}
if (Punishment[PunishmentExpired] > now) {
active++;
continue;
}
ExecuteForward(Forwards[FWD_PlayerAmnestying], FwdReturn, id, Punishment[PunishmentType]);
if (FwdReturn != PLUGIN_HANDLED) {
Punishment[PunishmentStatus] = APS_PunishmentStatusExpired
ArraySetArray(PlayersPunishment[id], i, Punishment, sizeof Punishment);
ExecuteForward(Forwards[FWD_PlayerAmnestied], FwdReturn, id, Punishment[PunishmentType]);
} else {
active++;
}
}
if (active == 0) {
remove_task(id + 100);
}
}
bool:punishPlayer(const player) {
ExecuteForward(Forwards[FWD_PlayerPunishing], FwdReturn, player, Punishment[PunishmentType]);
if (FwdReturn == PLUGIN_HANDLED) {
return false;
}
new GripJSONValue:request = grip_json_init_object();
new type[APS_MAX_TYPE_LENGTH];
ArrayGetString(Types, Punishment[PunishmentType], type, charsmax(type));
grip_json_object_set_string(request, "type", type);
if (Punishment[PunishmentExtra] == 0) {
grip_json_object_set_null(request, "extra");
} else {
grip_json_object_set_number(request, "extra", Punishment[PunishmentExtra]);
}
grip_json_object_set_number(request, "time", Punishment[PunishmentTime]);
grip_json_object_set_string(request, "reason", Punishment[PunishmentReason]);
if (Punishment[PunishmentDetails][0] != EOS) {
grip_json_object_set_string(request, "details", Punishment[PunishmentDetails]);
} else {
grip_json_object_set_null(request, "details");
}
if (Punishment[PunishmentPunisherID] > 0) {
grip_json_object_set_number(request, "punisher_id", Punishment[PunishmentPunisherID]);
}
if (GMX_PlayerIsLoaded(player)) {
grip_json_object_set_number(request, "player_id", GMX_PlayerGetPlayerId(player));
GMX_MakeRequest("punish", request, "OnPunished", get_user_userid(player));
grip_destroy_json_value(request);
} else {
new steamid[24], nick[32], ip[32];
get_user_authid(player, steamid, charsmax(steamid));
get_user_name(player, nick, charsmax(nick));
get_user_ip(player, ip, charsmax(ip), 1);
new emulator = 0;
if (has_reunion()) {
emulator = _:REU_GetAuthtype(player);
}
grip_json_object_set_number(request, "emulator", emulator);
grip_json_object_set_string(request, "steamid", steamid);
grip_json_object_set_string(request, "nick", nick);
grip_json_object_set_string(request, "ip", ip);
GMX_MakeRequest("punish/immediately", request, "OnPunished", get_user_userid(player));
grip_destroy_json_value(request);
}
return true;
}
bool:amnestyPlayer(const player) {
new GripJSONValue:request = grip_json_init_object();
grip_json_object_set_number(request, "punishment_id", Punishment[PunishmentID]);
GMX_MakeRequest("punish/amnesty", request, "OnAmnestied", get_user_userid(player));
grip_destroy_json_value(request);
return true;
}
parsePunishment(const GripJSONValue:punishment) {
arrayset(Punishment, 0, sizeof Punishment);
new GripJSONValue:tmp;
Punishment[PunishmentID] = grip_json_object_get_number(punishment, "id");
Punishment[PunishmentTime] = grip_json_object_get_number(punishment, "time");
new type[32];
grip_json_object_get_string(punishment, "type", type, charsmax(type));
Punishment[PunishmentType] = ArrayFindString(Types, type);
tmp = grip_json_object_get_value(punishment, "extra");
Punishment[PunishmentExtra] = grip_json_get_type(tmp) != GripJSONNull ? grip_json_get_number(tmp) : 0;
grip_destroy_json_value(tmp);
Punishment[PunishmentCreated] = grip_json_object_get_number(punishment, "created_at");
tmp = grip_json_object_get_value(punishment, "expired_at");
Punishment[PunishmentExpired] = grip_json_get_type(tmp) != GripJSONNull ? grip_json_get_number(tmp) : 0;
grip_destroy_json_value(tmp);
tmp = grip_json_object_get_value(punishment, "punisher_id");
if (grip_json_get_type(tmp) == GripJSONNumber) {
Punishment[PunishmentPunisherType] = APS_PunisherTypePlayer;
Punishment[PunishmentPunisherID] = grip_json_get_number(tmp);
grip_destroy_json_value(tmp);
} else {
grip_destroy_json_value(tmp);
tmp = grip_json_object_get_value(punishment, "punisher_user_id");
if (grip_json_get_type(tmp) == GripJSONNumber) {
Punishment[PunishmentPunisherType] = APS_PunisherTypeUser;
Punishment[PunishmentPunisherID] = grip_json_get_number(tmp);
} else {
Punishment[PunishmentPunisherType] = APS_PunisherTypeServer;
Punishment[PunishmentPunisherID] = 0;
}
grip_destroy_json_value(tmp);
}
tmp = grip_json_object_get_value(punishment, "reason");
if (grip_json_get_type(tmp) == GripJSONObject) {
grip_json_object_get_string(tmp, "title", Punishment[PunishmentReason], charsmax(Punishment[PunishmentReason]));
}
grip_destroy_json_value(tmp);
tmp = grip_json_object_get_value(punishment, "details");
if (grip_json_get_type(tmp) == GripJSONString) {
grip_json_get_string(tmp, Punishment[PunishmentDetails], charsmax(Punishment[PunishmentDetails]));
}
grip_destroy_json_value(tmp);
}
public plugin_natives() {
register_native("APS_RegisterType", "NativeRegisterType", 0);
register_native("APS_IsValidType", "NativeIsValidType", 0);
register_native("APS_GetTypesNum", "NativeGetTypesNum", 0);
register_native("APS_GetTypeIndex", "NativeGetTypeIndex", 0);
register_native("APS_GetTypeName", "NativeGetTypeName", 0);
register_native("APS_PunishPlayer", "NativePunishPlayer", 0);
register_native("APS_AmnestyPlayer", "NativeAmnestyPlayer", 0);
register_native("APS_GetPlayerPunishment", "NativeGetPlayerPunishment", 0);
register_native("APS_GetId", "NativeGetId", 0);
register_native("APS_GetExtra", "NativeGetExtra", 0);
register_native("APS_SetExtra", "NativeSetExtra", 0);
register_native("APS_GetTime", "NativeGetTime", 0);
register_native("APS_SetTime", "NativeSetTime", 0);
register_native("APS_GetCreated", "NativeGetCreated", 0);
register_native("APS_SetCreated", "NativeSetCreated", 0);
register_native("APS_GetExpired", "NativeGetExpired", 0);
register_native("APS_SetExpired", "NativeSetExpired", 0);
register_native("APS_GetReason", "NativeGetReason", 0);
register_native("APS_SetReason", "NativeSetReason", 0);
register_native("APS_GetDetails", "NativeGetDetails", 0);
register_native("APS_SetDetails", "NativeSetDetails", 0);
register_native("APS_GetPunisherType", "NativeGetPunisherType", 0);
register_native("APS_SetPunisherType", "NativeSetPunisherType", 0);
register_native("APS_GetPunisherId", "NativeGetPunisherId", 0);
register_native("APS_SetPunisherId", "NativeSetPunisherId", 0);
//register_native("APS_CheckPlayer", "NativeCheckPlayer", 0);
}
public APS_Type:NativeRegisterType(const plugin, const argc) {
enum { arg_type = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, APS_InvalidType)
new type[APS_MAX_TYPE_LENGTH];
get_string(arg_type, type, charsmax(type));
return APS_Type:ArrayPushString(Types, type);
}
public bool:NativeIsValidType(const plugin, const argc) {
enum { arg_type = 1 };
if (argc < arg_type) {
return false;
}
return bool:(0 <= get_param(arg_type) < TypesNum);
}
public NativeGetTypesNum(const plugin, const argc) {
return TypesNum;
}
public APS_Type:NativeGetTypeIndex(const plugin, const argc) {
enum { arg_type = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, APS_InvalidType)
new type[APS_MAX_TYPE_LENGTH];
get_string(arg_type, type, charsmax(type));
return APS_Type:ArrayFindString(Types, type);
}
public NativeGetTypeName(const plugin, const argc) {
enum { arg_type = 1, arg_value, arg_len };
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
new typeIndex = get_param(arg_type);
CHECK_NATIVE_TYPE_ERROR(typeIndex, 0)
new type[APS_MAX_TYPE_LENGTH];
ArrayGetString(Types, typeIndex, type, charsmax(type));
return set_string(arg_value, type, get_param(arg_len));
}
public bool:NativePunishPlayer(const plugin, const argc) {
enum { arg_player = 1, arg_type, arg_time, arg_reason, arg_details, arg_punisher_id, arg_extra };
arrayset(Punishment, 0, sizeof Punishment);
CHECK_NATIVE_ARGS_NUM(argc, 4, false)
new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)
Punishment[PunishmentType] = get_param(arg_type);
CHECK_NATIVE_TYPE_ERROR(Punishment[PunishmentType], false)
Punishment[PunishmentTime] = get_param(arg_time);
get_string(arg_reason, Punishment[PunishmentReason], charsmax(Punishment[PunishmentReason]));
get_string(arg_details, Punishment[PunishmentDetails], charsmax(Punishment[PunishmentDetails]));
new punisher = get_param(arg_punisher_id);
if (punisher != 0 && is_user_connected(punisher) && GMX_PlayerIsLoaded(punisher)) {
Punishment[PunishmentPunisherID] = GMX_PlayerGetPlayerId(punisher);
Punishment[PunishmentPunisherType] = APS_PunisherTypePlayer;
} else {
Punishment[PunishmentPunisherID] = 0;
Punishment[PunishmentPunisherType] = APS_PunisherTypeServer;
}
Punishment[PunishmentExtra] = get_param(arg_extra);
return punishPlayer(player);
}
public bool:NativeAmnestyPlayer(const plugin, const argc) {
enum { arg_player = 1, arg_type };
CHECK_NATIVE_ARGS_NUM(argc, 2, false)
new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)
new type = get_param(arg_type);
CHECK_NATIVE_TYPE_ERROR(type, false)
for (new i = 0, n = ArraySize(PlayersPunishment[player]); i < n; i++) {
ArrayGetArray(PlayersPunishment[player], i, Punishment, sizeof Punishment);
if (Punishment[PunishmentStatus] != APS_PunishmentStatusActive) {
continue;
}
if (Punishment[PunishmentType] == type) {
return amnestyPlayer(player);
}
}
return false;
}
public bool:NativeGetPlayerPunishment(const plugin, const argc) {
enum { arg_player = 1, arg_type };
arrayset(Punishment, 0, sizeof Punishment);
CHECK_NATIVE_ARGS_NUM(argc, 2, false)
new player = get_param(arg_player);
CHECK_NATIVE_PLAYER(player, false)
new type = get_param(arg_type);
CHECK_NATIVE_TYPE_ERROR(type, false)
for (new i = 0, n = ArraySize(PlayersPunishment[player]); i < n; i++) {
ArrayGetArray(PlayersPunishment[player], i, Punishment, sizeof Punishment);
if (Punishment[PunishmentStatus] != APS_PunishmentStatusActive) {
continue;
}
if (Punishment[PunishmentType] == type) {
return true;
}
}
return false;
}
public NativeGetId(const plugin, const argc) {
return Punishment[PunishmentID];
}
public NativeGetExtra(const plugin, const argc) {
return Punishment[PunishmentExtra];
}
public NativeSetExtra(const plugin, const argc) {
enum { arg_value = 1};
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentExtra] = get_param(arg_value);
return 1;
}
public NativeGetTime(const plugin, const argc) {
return Punishment[PunishmentTime];
}
public NativeSetTime(const plugin, const argc) {
enum { arg_value = 1};
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentTime] = get_param(arg_value);
return 1;
}
public NativeGetCreated(const plugin, const argc) {
return Punishment[PunishmentCreated];
}
public NativeSetCreated(const plugin, const argc) {
enum { arg_value = 1};
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentCreated] = get_param(arg_value);
return 1;
}
public NativeGetExpired(const plugin, const argc) {
return Punishment[PunishmentExpired];
}
public NativeSetExpired(const plugin, const argc) {
enum { arg_value = 1};
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentExpired] = get_param(arg_value);
return 1;
}
public NativeGetReason(const plugin, const argc) {
enum { arg_value = 1, arg_len };
CHECK_NATIVE_ARGS_NUM(argc, 2, 0)
return set_string(arg_value, Punishment[PunishmentReason], get_param(arg_len));
}
public NativeSetReason(const plugin, const argc) {
enum { arg_value = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
return get_string(arg_value, Punishment[PunishmentReason], charsmax(Punishment[PunishmentReason]));
}
public NativeGetDetails(const plugin, const argc) {
enum { arg_value = 1, arg_len };
CHECK_NATIVE_ARGS_NUM(argc, 2, 0)
return set_string(arg_value, Punishment[PunishmentDetails], get_param(arg_len));
}
public NativeSetDetails(const plugin, const argc) {
enum { arg_value = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
return get_string(arg_value, Punishment[PunishmentDetails], charsmax(Punishment[PunishmentDetails]));
}
public APS_PunisherType:NativeGetPunisherType(const plugin, const argc) {
return Punishment[PunishmentPunisherType];
}
public NativeSetPunisherType(const plugin, const argc) {
enum { arg_value = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentPunisherType] = APS_PunisherType:get_param(arg_value);
return 1;
}
public NativeGetPunisherId(const plugin, const argc) {
return Punishment[PunishmentPunisherID];
}
public NativeSetPunisherId(const plugin, const argc) {
enum { arg_value = 1 };
CHECK_NATIVE_ARGS_NUM(argc, 1, 0)
Punishment[PunishmentPunisherID] = get_param(arg_value);
return 1;
}
checkAPIVersion() {
for(new i, n = get_pluginsnum(), status[2], func; i < n; i++) {
if(i == PluginId) {
continue;
}
get_plugin(i, .status = status, .len5 = charsmax(status));
//status debug || status running
if(status[0] != 'd' && status[0] != 'r') {
continue;
}
func = get_func_id("__aps_version_check", i);
if(func == -1) {
continue;
}
if(callfunc_begin_i(func, i) == 1) {
callfunc_push_int(APS_MAJOR_VERSION);
callfunc_push_int(APS_MINOR_VERSION);
callfunc_end();
}
}
}
В gmx-web причины наказания добавил, но в меню таких как aps_banmenu, aps_plmenu причины не отображаются.
В этой теме было размещено решение! Перейти к решению.
Вложения
-
1,007 KB Просмотры: 375