[ACS] Weapon Control System 1.3.9.4

Сообщения
13
Реакции
0
Ошибка
################
# Hello World! #
################

[REFSAPI] ReHLDS API successfully initialized.
[REFSAPI] ReGAME API successfully initialized.
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294 (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: Dec 3 2021 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
ReGamedll
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
Версия Metamod
Metamod-r v1.3.0.149, API (5:13)
Metamod-r build: 11:31:17 Apr 23 2024
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/603a257
Список метамодулей
[ 1] Reunion RUN - reunion_mm_i386.so v0.2.0.13 ini Start Never
[ 2] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.5 ini Start ANY
[ 3] Accuracy Fix (ACS) RUN - accuracyfix_mm.so v1.0.7a ini ANY ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder.so v2017RC5 ini ANY ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 8] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[ 9] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[11] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[14] RefsAPI RUN - refsapi_amxx_i386.so v1.0.1 pl7 ANY Never
[15] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl7 ANY Never
[16] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl7 ANY Never
[17] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[18] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
[19] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5294 pl7 ANY ANY
19 plugins, 19 running
Список плагинов
name version author file status
[ 1] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 2] FreshBans 1.4.8b kanagava fresh_bans.amxx running
[ 3] ScreenMaker 1.1 neygomon screenmaker.amx running
[ 4] Custom Player Models A 0.2.6 F@nt0M & BlackSi custom_player_m running
[ 5] Custom Player Models C 0.2.2 BlackSignature custom_player_m running
[ 6] Custom Player Models T 0.2.1 BlackSignature custom_player_m running
[ 7] [GM] Weapon Models 2.0.0 [GM] NWC gm_weapon_model running
[ 8] GameCMS_API 5.6.3 zhorzh78 gamecms_api_5.6 running
[ 9] GameCMS_GagManager 2.2.7 ReAp zhorzh78 gamecms_gagmana running
[ 10] GameCMS_Informer 2.3 API5 zhorzh78 gamecms_informe running
[ 11] Top Awards 1.2.0 szawesome top_awards.amxx running
[ 12] KNIFE Models 2.1.4 OciXCrom knife-models.am running
[ 13] Custom skies 0.0.1 Nordic Warrior CustomSkies.amx running
[ 14] Save Data Registration 1.1.0 GM-X Team, cpctr Regs_Player.amx running
[ 15] GameName Changer 1.0.0 Nordic Warrior GameNameChanger running
[ 16] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 17] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 18] New Kick Menu 1.2.8 Radius newkickmenu.amx running
[ 19] [Customizable] AmxModM 0.0.5 Albertio amxmodmenu.amxx running
[ 20] Players Menu 1.7 neugomon players_menu.am running
[ 21] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 22] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 23] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 24] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 25] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 26] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 27] Mode 2x2 2.5re s1lent mode.amxx running
[ 28] Maps Menu 1.10.0.546 AMXX Dev Team mapsmenu.amxx running
[ 29] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 30] Auto Logs Cleaner 0.0.1 b0t. auto_logs_clean running
[ 31] unknown unknown unknown Server-Side_Smo running
[ 32] ACS injection med-kit 1.0.6.2 DEV-CS.RU acs_injection.a running
[ 33] Block Manager 1.1 maFFyoZZyk block_manager.a running
[ 34] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 35] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 36] Reklama 20.05.2020 mx?! reklama.amxx running
[ 37] Team Select 1.6.0 F@nt0M teamselect.amxx running
[ 38] Map List Generator 1.3 Leo_[BH] mapslist_genera running
[ 39] Team Balancer 1.8b3 Ptahhotep ptb.amxx running
[ 40] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 41] Demo recorder 1.3.2 WessTorn demo_recorder.a running
[ 42] C4 Timer & Sound 0.4 iceeedR C4_hudtimer.amx running
[ 43] AFK Control 1.0.3 Emma Jule reapi_afk.amxx running
[ 44] FirstPlayersRespawn 1.0.0 Emma Jule FirstPlayersRes running
[ 45] [GeoIP] Connect Info 1.0.0 Nordic Warrior geoip_connect_i running
[ 46] WeaponBox Angles 0.0.1 b0t. WeaponBoxAngles running
[ 47] Simple Online Logger 23.05.19 mx?! simple_online_l running
[ 48] Trial Access 1.0.2 mx?! trial_access.am running
[ 49] HeadShot Sounds 0.2 ConnorMcLeod headshots_sound running
[ 50] Regen HP AP for knife 1.0 mx?! knife_regen.amx running
[ 51] FAST INSTALL C4 1.5 MayroN fast_install_c4 running
[ 52] Revive Teammates: Core 2.2.11 DEV-CS.RU Commun rt_core.amxx running
[ 53] Revive Teammates: Plan 2.2.11 DEV-CS.RU Commun rt_planting.amx running
[ 54] Revive Teammates: Rest 2.2.11 DEV-CS.RU Commun rt_restrictions running
[ 55] Revive Teammates: Time 2.2.11 DEV-CS.RU Commun rt_timer.amxx running
[ 56] Revive Teammates: Effe 2.2.5 DEV-CS.RU Commun rt_effects.amxx running
[ 57] Revive Teammates: Soun 2.2.11 DEV-CS.RU Commun rt_sounds.amxx running
[ 58] Revive Teammates: Bonu 2.2.11 DEV-CS.RU Commun rt_bonus.amxx running
[ 59] Map Manager: Core 3.2.1 Mistrick map_manager_cor running
[ 60] Map Manager: Scheduler 0.2.1 Mistrick map_manager_sch running
[ 61] Map Manager: Rtv 0.1.5 Mistrick map_manager_rtv running
[ 62] Map Manager: Nominatio 0.3.5 Mistrick map_manager_nom running
[ 63] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 64] Map Manager: Online ch 1.0.3 Sergey Shorokhov map_manager_onl running
[ 65] Map Manager: Effects 0.1.3 Mistrick map_manager_eff running
[ 66] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 67] Map Manager: Sounds 0.0.3 Mistrick map_manager_sou running
[ 68] [190] Skill ELO 22.11.15 SKAJIbnEJIb skill_elo.amxx running
[ 69] [190] CsStats MySQL 22.11.15 SKAJIbnEJIb csstats_mysql.a running
[ 70] [190] StatsX RBS 21.03.23 SKAJIbnEJIb & AM statsx_rbs.amxx running
[ 71] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 72] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 73] Simple Damager 2.1.0 fl0wer simple_damager. running
Автор плагина
Refresh
Версия плагина
1.3.9.4
Исходный код
#include <acs_wcs>

/*
set_cvar_string("mp_forcerespawn", "0");
set_cvar_string("mp_respawn_immunitytime", "0");
set_cvar_string("mp_round_infinite", "0");
*/

public acs_stats() {
new i_sum;
log_acs("CVAR = %d ", sizeof(CVAR)); i_sum += sizeof(CVAR);
log_acs("ga_weapon_data = %d ", ArraySize(ga_weapon_data) * ACS_WCS); i_sum += ArraySize(ga_weapon_data) * ACS_WCS;
log_acs("ga_weapon_limit = %d ", ArraySize(ga_weapon_limit) * ACS_WCS_LIMITS); i_sum += ArraySize(ga_weapon_limit) * ACS_WCS_LIMITS;
log_acs("ga_menu_data = %d ", ArraySize(ga_menu_data) * ACS_WCS_MENU); i_sum += ArraySize(ga_menu_data) * ACS_WCS_MENU;
log_acs("ga_adv_limits = %d ", ArraySize(ga_adv_limits) * ACS_WCS_ADV_LIMITS); i_sum += ArraySize(ga_adv_limits) * ACS_WCS_ADV_LIMITS;
log_acs("ga_filters = %d ", ArraySize(ga_filters[0]) * ACS_WCS_ADV_FILTER_TYPES * ACS_WCS_AVD_FILTERS); i_sum += ArraySize(ga_filters[0]) * ACS_WCS_ADV_FILTER_TYPES * ACS_WCS_AVD_FILTERS;
log_acs("gt_weapon_owner = %d ", TrieGetSize(gt_weapon_owner)); i_sum += TrieGetSize(gt_weapon_owner);
log_acs("gt_weapon_limit = %d ", TrieGetSize(gt_weapon_limit)); i_sum += TrieGetSize(gt_weapon_limit);
log_acs("gt_adv_limit = %d ", TrieGetSize(gt_adv_limit)); i_sum += TrieGetSize(gt_adv_limit);
log_acs("gt_weapon_clcmd = %d ", TrieGetSize(gt_weapon_clcmd)); i_sum += TrieGetSize(gt_weapon_clcmd);
log_acs("gt_weapon_recoil = %d ", TrieGetSize(gt_weapon_recoil)); i_sum += TrieGetSize(gt_weapon_recoil);
log_acs("gt_weapon_last_round = %d ", TrieGetSize(gt_weapon_last_round)); i_sum += TrieGetSize(gt_weapon_last_round);
log_acs("gf_touch_time = %d ", sizeof(gf_touch_time)); i_sum += sizeof(gf_touch_time);
log_acs("ACS_PRINT_THR = %d ", sizeof(ACS_PRINT_THR)); i_sum += sizeof(ACS_PRINT_THR);
log_acs("gi_add_speed = %d ", sizeof(gi_add_speed)); i_sum += sizeof(gi_add_speed);
log_acs("ga_damager = %d ", sizeof(ga_damager)); i_sum += sizeof(ga_damager);
log_acs("ga_killfader = %d ", sizeof(ga_killfader)); i_sum += sizeof(ga_killfader);
log_acs("ga_evasion = %d ", sizeof(ga_evasion)); i_sum += sizeof(ga_evasion);
log_acs("ga_vampire = %d ", sizeof(ga_vampire)); i_sum += sizeof(ga_vampire);
log_acs("ga_multi_jump = %d ", sizeof(ga_multi_jump)); i_sum += sizeof(ga_multi_jump);
log_acs("TOTAL = %d ", i_sum );
log_acs("ENTITY COUNT = %d (%d)", entity_count(), gi_max_entities);
}

public plugin_init() {
register_plugin("ACS Weapon Control System", "1.3.9.4", "DEV-CS.RU");
register_message(get_user_msgid("SendAudio"), "msg_send_audio");
RegisterHookChain(RG_CSGameRules_CheckMapConditions, "new_round", true);
RegisterHookChain(RG_RoundEnd, "RoundEnd_Pre");
register_concmd("wcsmenu", "cmd_menu");
register_concmd("vipmenu", "cmd_menu");
register_concmd("wcs_damager", "cmd_damager");
register_clcmd("say /damager", "cmd_damager");
register_clcmd("say_team /damager", "cmd_damager");
register_concmd("wcs_killfader", "cmd_killfader");
register_clcmd("say /killfader", "cmd_killfader");
register_clcmd("say_team /killfader", "cmd_killfader");
//register_concmd("wcstest", "cmd_wcstest");
register_concmd("acs_give_weapon", "cmd_give_weapon", ADMIN_ALL, "<name or #userid> <weapon_name>");
register_concmd("wcs_offline_reset", "cmd_offline_reset", ADMIN_RCON);
register_concmd("round_end", "cmd_round_end", ADMIN_RCON, "<delay> <id string>");
register_concmd("remove_all_weapons", "cmd_remove_all_weapons", ADMIN_RCON);
RegisterHam(Ham_Touch, "weaponbox", "Touch_Pre");
RegisterHam(Ham_TraceAttack, "player", "TraceAttack_Post", true);
RegisterHam(Ham_TraceAttack, "worldspawn", "TraceAttack_Post", true);
RegisterHam(Ham_TraceAttack, "info_target", "TraceAttack_Post", true);
RegisterHam(Ham_TraceAttack, "func_breakable", "TraceAttack_Post", true);
RegisterHam(Ham_TraceAttack, "hostage_entity", "TraceAttack_Post", true);
RegisterHookChain(RG_CWeaponBox_SetModel, "CWeaponBox_SetModel_Pre");
//RegisterHookChain(RG_CSGameRules_PlayerSpawn, "CSGameRules_PlayerSpawn_Post", true);
RegisterHookChain(RG_CBasePlayer_OnSpawnEquip, "CBasePlayer_OnSpawnEquip_Post", true);
//RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true);
RegisterHookChain(RG_CBasePlayer_AddPlayerItem, "CBasePlayer_AddPlayerItem_Pre");
RegisterHookChain(RG_CBasePlayer_HasRestrictItem, "CBasePlayer_HasRestrictItem_Pre");
RegisterHookChain(RG_CBasePlayer_ResetMaxSpeed, "CBasePlayer_ResetMaxSpeed_Post", true);
RegisterHookChain(RG_CSGameRules_CanHavePlayerItem, "CSGameRules_CanHavePlayerItem_Pre");
RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "CBasePlayerWeapon_DefaultDeploy_Pre");
RegisterHookChain(RG_CSGameRules_DeadPlayerWeapons, "CSGameRules_DeadPlayerWeapons_Pre");
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true);
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage_Post", true);
RegisterHookChain(RG_CSGameRules_FPlayerCanTakeDamage, "CSGameRules_FPlayerCanTakeDamage");
RegisterHookChain(RG_PM_Move, "PM_Move_Post", true);
RegisterHookChain(RG_CSGameRules_OnRoundFreezeEnd, "CSGameRules_OnRoundFreezeEnd");
RegisterHookChain(RG_CreateWeaponBox, "CreateWeaponBox_Post", true);
RegisterHookChain(RG_CBasePlayer_Jump, "CBasePlayer_Jump_Pre");
RegisterHookChain(RG_PlantBomb, "PlantBomb_Post", true);
RegisterHookChain(RG_CGrenade_DefuseBombStart, "CGrenade_DefuseBombStart_Post", true);
RegisterHookChain(RG_CGrenade_DefuseBombEnd, "CGrenade_DefuseBombEnd_Post", true);
//Fix ReGame's crazy
RegisterHookChain(RG_CSGameRules_GiveC4, "CSGameRules_GiveC4_Pre");
RegisterHookChain(RG_CBasePlayer_MakeBomber, "CBasePlayer_MakeBomber_Pre");
gi_max_entities = get_global_int(GL_maxEntities);
log_acs("Total entity on map: %d", entity_count());
}

public plugin_precache() {
if (file_exists(fmt("sound/%s", ACS_SOUND_NOTIFY)))
precache_sound(ACS_SOUND_NOTIFY);
if (file_exists(fmt("sound/%s", ACS_SOUND_REJECT)))
precache_sound(ACS_SOUND_REJECT);
if (file_exists(ACS_SPRITE_LAZER))
gh_lazer_beam = precache_model(ACS_SPRITE_LAZER);
else
log_acs("Error: sprite of lazer beam not found!");
if (!register_dictionary("acs_wcs.txt"))
log_acs("Error: dictionary file not found!");
// Fix AMXX lang bug for first server start, amxx.cfg not loaded yet??! (amx_language = en)
rf_set_cvar_str("amx_language", "en"); // <--- set this to you default lang in acs_wcs.txt (2 chars ISO)
acs_load_cfg("acs_wcs.ini");
}

public plugin_cfg() {
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_prefix", "^4[WEAPONS]", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_PREFIX")), _SC(CVAR[PREFIX]));
rf_bind_pcvar_flt(rf_create_cvar("acs_wcs_buy_time", "0.0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_BUYTIME"), .has_min = true, .min_val = 0.0), CVAR[BUYTIME]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_buy_zone", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_BUYZONE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[BUYZONE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_discount", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_DISCOUNT"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 100.0), CVAR[DISCOUNT]);
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_cmd_access", "s", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_CMD_ACCESS")), _SC(CVAR[CMD_ACCESS]));
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_give_type", "2", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_GIVE_TYPE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 2.0), CVAR[GIVE_TYPE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_pickup_access_type", "1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_PICKUP_ACCESS_TYPE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[PICKUP_ACCESS_TYPE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_trace_type", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_TRACE_TYPE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[TRACE_TYPE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_notify_mode", "-1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_NOTIFY_MODE"), .has_min=true, .min_val=-1.0, .has_max=true, .max_val=8192.0), CVAR[NOTIFY_MODE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_notify_sound_mode", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_NOTIFY_SOUND_MODE"), .has_min=true, .min_val=-1.0, .has_max=true, .max_val=8192.0), CVAR[NOTIFY_SOUND_MODE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_win_diff_mode", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_DIFF_MODE"), .has_min=true, .min_val=0.0, .has_max=true, .max_val=1.0), CVAR[DIFF_MODE]);
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_aes_plugin_filename", "aes_main.amxx", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_AES_PLUGIN")), _SC(CVAR[AES_PLUGIN]));
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_csx_plugin_filename", "csstatsx_sql.amxx", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_CSX_PLUGIN")), _SC(CVAR[CSX_PLUGIN]));
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_gamecms_plugin_filename", "gamecms_api.amxx", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_GAMECMS_PLUGIN")), _SC(CVAR[GAMECMS_PLUGIN]));
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_restore_maxspeed", "320", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_RESTORE_MAXSPEED"), .has_min=true, .min_val=0.0, .has_max=true, .max_val=2000.0), CVAR[RESTORE_MAXSPEED]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_vipmenu_round", "4", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_VIPMENU_ROUND"), .has_min=true, .min_val=0.0, .has_max=true, .max_val=100.0), CVAR[VIPMENU_ROUND]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_vipmenu_timeout", "3", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_VIPMENU_TIMEOUT"), .has_min=true, .min_val=-30.0, .has_max=true, .max_val=30.0), CVAR[VIPMENU_TIMEOUT]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_vipmenu_mode", "1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_VIPMENU_MODE"), .has_min=true, .min_val=0.0, .has_max=true, .max_val=100.0), CVAR[VIPMENU_MODE]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_max_item_money", "16000", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_MAX_MONEY"), .has_min=true, .min_val=1.0, .has_max=true, .max_val=16000.0), CVAR[MAX_MONEY]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_max_item_hp", "100", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_MAX_HP"), .has_min=true, .min_val=1.0, .has_max=true, .max_val=1000.0), CVAR[MAX_HP]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_max_item_armor", "100", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_MAX_ARMOR"), .has_min=true, .min_val=1.0, .has_max=true, .max_val=1000.0), CVAR[MAX_ARMOR]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_max_item_ammo", "250", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_MAX_AMMO"), .has_min=true, .min_val=1.0, .has_max=true, .max_val=1000.0), CVAR[MAX_AMMO]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_max_item_speed", "900", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_MAX_SPEED"), .has_min=true, .min_val=1.0, .has_max=true, .max_val=2000.0), CVAR[MAX_SPEED]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_round_control", "1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_ROUND_CONTROL"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[ROUND_CONTROL]);
rf_bind_pcvar_str(rf_create_cvar("acs_wcs_server_name", "", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_SERVER_NAME")), _SC(CVAR[SERVER_NAME]));
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_log", "0", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_LOG"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[LOG]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_dynamic_limits", "1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_DYNAMIC_LIMITS"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[DYNAMIC_LIMITS]);
rf_bind_pcvar_num(rf_create_cvar("acs_wcs_players_num_mode", "1", .desc = rf_fmt("%L", LANG_SERVER, "CVAR_NUM_MODE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), CVAR[NUM_MODE]);
// DEFAULT WEAPON RECOIL (25)
R("ak47", "1.0"); R("aug", "1.0"); R("awp", "1.0"); R("deagle", "1.0"); R("elite", "1.0");
R("famas", "1.0"); R("fiveseven", "1.0"); R("g3sg1", "1.0"); R("galil", "1.0"); R("glock", "1.0");
R("glock18", "1.0"); R("m249", "1.0"); R("m3", "1.0"); R("m4a1", "1.0"); R("mac10", "1.0");
R("mp5navy", "1.0"); R("p228", "1.0"); R("p90", "1.0"); R("scout", "1.0"); R("sg550", "1.0");
R("sg552", "1.0"); R("tmp", "1.0"); R("ump45", "1.0"); R("usp", "1.0"); R("xm1014", "1.0");
// OVERRIDE DEFAULT RECOIL
R("all", "1.0");
acs_config(true, "acs_wcs");
}

public plugin_natives() {
set_native_filter("native_filter");
}

public native_filter(const native_name[], index, trap) {
static i_i;
for (i_i = 0; i_i < sizeof(_NATIVES); i_i++)
if (equal(native_name, _NATIVES[i_i]))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}

public plugin_end() {
}

public client_connect(id) {
}

public client_putinserver(id) {
if (!is_user_hltv(id)) {
set_bit(gi_client_connected, id);
acs_get_gamecms_data(id);
menu_control_reset(id);
acs_load_user_damager(id);
acs_load_user_fader(id);
}
}

public client_disconnected(id, bool:drop, message[], maxlen) {
reset_bit(gi_client_connected, id);
gf_touch_time[id] = 0.0;
gb_aes_init[id] = false;
}

public aes_player_connect(id) {
gb_aes_init[id] = true;
log_acs("AES INIT!!! id = %d, _AES_EXIST = %d", id, _AES_EXIST(id));
}

public csxsql_initialized() {
gb_csx_init = true;
log_acs("CSSTATSX LOADED!!!");
}

public OnAPIPluginLoaded(Handle:sql_tuple, version[], server_id) {
gb_gamecms_init = true;
log_acs("GAMECMS LOADED!!! server_id = %d, plugin_version = %s", server_id, version);
}

public OnAPIPluginStop() {
gb_gamecms_init = false;
log_acs("GAMECMS FAILED!!!");
}

public new_round() {
gf_round_start = get_gametime();
gb_round_infinite = rf_get_pcvar_num(gp_cvar_round_infinite) || rf_get_pcvar_num(gp_cvar_forcerespawn);
gi_total_rounds_played++;
gb_STOP =
gb_block_C4 =
gb_task_timer =
gb_task_process =
gb_bomb_planted =
gb_task_process_delay = false;
remove_task(TASK_TIMER);
remove_task(TASK_PROCESS);
ArrayClear(ga_weapon_limit);
TrieClear(gt_weapon_limit);
TrieClear(gt_weapon_owner);
TrieClear(gt_weapon_groups);
if (CVAR[RESTORE_MAXSPEED] > 0 && CVAR[RESTORE_MAXSPEED] != rf_get_pcvar_num(gp_cvar_maxspeed))
rf_set_pcvar_num(gp_cvar_maxspeed, CVAR[RESTORE_MAXSPEED]);
if (get_member_game(m_iIntroRoundTime))
gb_freeze_time = true;
acs_check_event(0, ACS_ET_ROUND_START);
log_acs("CURRENT ROUND = %d, m_bGameStarted = %d", get_current_round(), get_member_game(m_bGameStarted));
}

public CBasePlayer_MakeBomber_Pre(const id) {
if (gb_block_C4) {
set_member_game(m_iC4Guy, 0);
set_member_game(m_bBombDropped, true);
SetHookChainReturn(ATYPE_BOOL, true);
return HC_BREAK;
}
return HC_CONTINUE;
}

public CSGameRules_GiveC4_Pre(const id) {
if (gb_block_C4) {
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}

public RoundEnd_Pre(WinStatus:status, ScenarioEventEndRound:event, Float:tm_delay) {
log_acs("RoundEnd_Pre(): current_round = %d, event = %d, delay = %f", get_current_round(), event, tm_delay);
if (CVAR[ROUND_CONTROL] && event == ROUND_GAME_COMMENCE) {
set_member_game(m_bGameStarted, true); // ...
SetHookChainReturn(ATYPE_BOOL, false);
return HC_SUPERCEDE;
}
gb_STOP = true;
if (WINSTATUS_CTS <= status <= WINSTATUS_TERRORISTS)
acs_check_event(0, status == WINSTATUS_CTS ? ACS_ET_WIN_CT | ACS_ET_ROUND_END : ACS_ET_WIN_TT | ACS_ET_ROUND_END);
acs_stats();
return HC_CONTINUE;
}

public CSGameRules_OnRoundFreezeEnd() {
gb_freeze_time = false;
}

public CreateWeaponBox_Post(const weapon_ent, const owner, model_name[], Float:origin[3], Float:angles[3], Float:velocity[3], Float:life_time, bool:pack_ammo) {
static i_key, s_classname[ACS_MAX_NAME_LENGTH], a_weapon[ACS_WCS];
if (CVAR[DYNAMIC_LIMITS]) {
get_entvar(weapon_ent, var_classname, _SC(s_classname));
//acs_client_print(owner, ACS_SHOW_DEBUG, "DROP ENTITY = %d, classname = %s, is_custom = %d", weapon_ent, s_classname, is_custom_weapon(weapon_ent));
acs_dec_weapon_limit(owner, s_classname);
if (is_custom_weapon(weapon_ent) && 0 <= (i_key = get_wk(weapon_ent) - WCS_IMPULSE_OFFSET) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
acs_dec_weapon_limit(owner, a_weapon[WCS_WEAPON]);
// SKIP EXT_ & KNIFES FOR *
if (contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX) && !equal(a_weapon[WCS_WEAPON_REFERENCE], "weapon_knife"))
acs_dec_weapon_limit(owner, ACS_WEAPON_ALL_KEY);
}
}
}

public CBasePlayer_Jump_Pre(const id) {
static i_flags, Float:fv_velocity[3], Float:f_last_usage[MAX_PLAYERS + 1];
if (ga_multi_jump[id][MJ_ENABLED] && is_user_alive(id) && !(((i_flags = get_entvar(id, var_flags)) & FL_WATERJUMP) && get_entvar(id, var_waterlevel) >= 2)) {
if (i_flags & FL_ONGROUND)
ga_multi_jump[id][MJ_COUNT] = 0;
else if ((get_entvar(id, var_button) & IN_JUMP) && !(get_entvar(id, var_oldbuttons) & IN_JUMP) && NO_RATTLE
&& (!ga_multi_jump[id][MJ_MAX_COUNT] || ga_multi_jump[id][MJ_COUNT] < ga_multi_jump[id][MJ_MAX_COUNT])) {
f_last_usage[id] = get_gametime();
get_entvar(id, var_velocity, fv_velocity);
if (ga_multi_jump[id][MJ_RELATIVE]) {
if (ga_multi_jump[id][MJ_VELOCITY][0] > 0.0)
fv_velocity[0] *= ga_multi_jump[id][MJ_VELOCITY][0] / 100.0;
if (ga_multi_jump[id][MJ_VELOCITY][1] > 0.0)
fv_velocity[1] *= ga_multi_jump[id][MJ_VELOCITY][1] / 100.0;
if (ga_multi_jump[id][MJ_VELOCITY][2] > 0.0 && floatsign(fv_velocity[2]) >= 0.0)
fv_velocity[2] *= ga_multi_jump[id][MJ_VELOCITY][2] / 100.0;
} else {
if (ga_multi_jump[id][MJ_VELOCITY][0] > 0.0)
fv_velocity[0] = floatsign(fv_velocity[0]) * ga_multi_jump[id][MJ_VELOCITY][0];
if (ga_multi_jump[id][MJ_VELOCITY][1] > 0.0)
fv_velocity[1] = floatsign(fv_velocity[1]) * ga_multi_jump[id][MJ_VELOCITY][1];
if (ga_multi_jump[id][MJ_VELOCITY][2] > 0.0)
fv_velocity[2] = ga_multi_jump[id][MJ_VELOCITY][2];
}
set_entvar(id, var_velocity, fv_velocity);
set_entvar(id, var_gaitsequence, 6);
if (ga_multi_jump[id][MJ_MAX_COUNT])
ga_multi_jump[id][MJ_COUNT]++;
}
}
return HC_CONTINUE;
}

public PM_Move_Post(const id) {
if (CVAR[VIPMENU_TIMEOUT] > 0 && is_valid_player(id) && !is_user_bot(id) && g_menu_control[id][MC_MENU_OPEN] && !g_menu_control[id][MC_START_TIMER]) {
if (get_ucmd(get_pmove(pm_cmd), ucmd_buttons) & (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "move()-> %d", buttons);
if (g_menu_control[id][MC_MOVE_START] > 0.0) {
if (get_gametime() - g_menu_control[id][MC_MOVE_START] > 0.618) {
g_menu_control[id][MC_START_TIMER] = true;
menu_set_timeout(id, g_menu_control[id][MC_MENU_HANDLE], CVAR[VIPMENU_TIMEOUT]);
}
} else
g_menu_control[id][MC_MOVE_START] = get_gametime();
} else
g_menu_control[id][MC_MOVE_START] = 0.0;
}
}

public msg_send_audio(msg_id, msg_dest, msg_entity) {
static s_sample[MAX_RESOURCE_PATH_LENGTH];
//id = get_msg_arg_int(1);
get_msg_arg_string(2, _SC(s_sample));
//acs_client_print(0, ACS_SHOW_DEBUG, "msg_id = %d, msg_dest = %d, msg_entity = %d, id = %d, sample = %s, block_audio = %d", msg_id, msg_dest, msg_entity, id, s_sample, gi_block_send_audio);
if (((gi_block_send_audio & ACS_ET_BOMB_PLANTED) && equal(s_sample, "%!MRAD_BOMBPL"))
|| ((gi_block_send_audio & ACS_ET_BOMB_DEFUSED) && equal(s_sample, "%!MRAD_BOMBDEF"))
|| ((gi_block_send_audio & ACS_ET_WIN_TT) && equal(s_sample, "%!MRAD_terwin"))
|| ((gi_block_send_audio & ACS_ET_WIN_CT) && equal(s_sample, "%!MRAD_ctwin")))
return PLUGIN_HANDLED;
return PLUGIN_CONTINUE;
}

public bomb_planting(const id) {
static i_active_item;
if (get_member(id, m_iTeam) == TEAM_TERRORIST && !is_nullent((i_active_item = get_member(id, m_pActiveItem))) && get_member(i_active_item, m_iId) == WEAPON_C4 && get_member(i_active_item, m_C4_bStartedArming))
acs_check_event(id, ACS_ET_BOMB_PLANTING);
}

public PlantBomb_Post(const id, Float:vec_start[3], Float:vec_velocity[3]) {
gb_STOP =
gb_bomb_planted = true;
acs_check_event(id, ACS_ET_BOMB_PLANTED);
}

public CGrenade_DefuseBombStart_Post(const ent, const id) {
acs_check_event(id, ACS_ET_BOMB_DEFUSING);
}

public CGrenade_DefuseBombEnd_Post(const ent, const id, bool:is_defused) {
if (is_defused)
acs_check_event(id, ACS_ET_BOMB_DEFUSED);
}

public CBasePlayer_Killed_Post(victim, killer) {
static i_active_item, f_data[ACS_WCS_FILTER_TASK];
if (is_valid_player(victim)) {
if (g_menu_control[victim][MC_MENU_OPEN]
&& g_menu_control[victim][MC_MENU_TYPE] != MENU_OPTIONS_DAMAGER
&& g_menu_control[victim][MC_MENU_TYPE] != MENU_OPTIONS_KILLFADER)
acs_close_user_menu(victim);
if (is_valid_player(killer)) {
get_user_name(victim, _SC(f_data[ACS_FT_NAME]));
f_data[ACS_FT_ID] = killer;
f_data[ACS_FT_TYPE] = victim == killer ? ACS_ET_KILL_SELF : ACS_ET_KILL;
f_data[ACS_FT_FILTER] = WCS_ADV_EVENTS;
f_data[ACS_FT_GIVE_ITEMS] = true;
if (get_member(victim, m_bKilledByBomb))
f_data[ACS_FT_TYPE] |= ACS_ET_KILL_BOMB;
if (get_member(victim, m_bKilledByGrenade))
f_data[ACS_FT_TYPE] |= ACS_ET_KILL_HE;
if (f_data[ACS_FT_TYPE] == ACS_ET_KILL && !is_nullent((i_active_item = get_member(killer, m_pActiveItem))) && get_member(i_active_item, m_iId) == WEAPON_KNIFE)
f_data[ACS_FT_TYPE] |= ACS_ET_KILL_KNIFE;
if (get_member(victim, m_bHeadshotKilled))
f_data[ACS_FT_TYPE] |= ACS_ET_KILL_HS;
set_task(0.1, "acs_check_filter", TASK_EVENT + f_data[ACS_FT_ID], _SS(f_data));
acs_check_killfader(killer, f_data[ACS_FT_TYPE]);
if (ga_vampire[killer][VPR_ENABLED] && is_user_alive(killer) && !ga_vampire[killer][VPR_RELATIVE])
ExecuteHamB(Ham_TakeHealth, killer, float(ga_vampire[killer][VPR_MAGNITUDE]), DMG_GENERIC);
}
}
}

public CBasePlayer_TakeDamage_Post(const victim, weapon, killer, Float:damage, damage_type) {
static Float:f_hp;
acs_check_damager(victim, killer, Float:damage, damage_type);
if (is_valid_player(killer) && is_user_alive(killer) && ga_vampire[killer][VPR_ENABLED] && ga_vampire[killer][VPR_RELATIVE] && !(damage_type & DMG_BLAST)) {
f_hp = damage * ga_vampire[killer][VPR_MAGNITUDE] / 100.0;
f_hp = rf_roundfloat(f_hp);
log_acs("VAMPIRE: killer = %d, enable = %d, hp = %f", killer, ga_vampire[killer][VPR_ENABLED], f_hp);
if (ga_vampire[killer][VPR_MAGNITUDE] > 0)
ExecuteHamB(Ham_TakeHealth, killer, f_hp, DMG_POISON);
else
ExecuteHamB(Ham_TakeDamage, killer, weapon, victim, -f_hp, DMG_BURN);
}
}

public CSGameRules_FPlayerCanTakeDamage(const id, const attacker) {
if (ga_evasion[id][EV_ENABLED]) {
if (acs_random_num(0, 99, ACS_WCS_EVASION_RND_KEY) < ga_evasion[id][EV_PROBABILITY]) {
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_BREAK;
}
}
return HC_CONTINUE;
}

public CBasePlayer_OnSpawnEquip_Post(const id, const bool:add_default, const bool:equip_game) {
if (is_valid_player(id)) {
log_acs("SPAWN POST [ %d ]: id = %d, add_default = %d, equip_game = %d", get_current_round(), id, add_default, equip_game);
gi_add_speed[id][SPEED_VALUE] = 0;
gi_add_speed[id][SPEED_RELATIVE] =
ga_damager[id][DMG_ENABLED] =
ga_killfader[id][KF_ENABLED] =
ga_evasion[id][EV_ENABLED] =
ga_vampire[id][VPR_ENABLED] =
ga_multi_jump[id][MJ_ENABLED] = false;
set_member(id, m_bAutoBunnyHopping, false);
set_member(id, m_bMegaBunnyJumping, false);
remove_task(TASK_PROCESS + id);
rg_reset_maxspeed(id);
TrieDeleteKey(gt_weapon_groups, fmt(ACS_WCS_WP_GROUP_KEY, id));
set_task(0.1, "task_acs_adv_task", TASK_ADV_TASK + id);
} else
log_acs("[WCS] Invalid player %d, hltv = %d", id, is_user_hltv(id));
}

public task_acs_adv_task(const task_id) {
static id, i_i, i_count, i_key, i_weapons[32], s_classname[ACS_MAX_NAME_LENGTH], a_weapon[ACS_WCS];
new f_data[ACS_WCS_FILTER_TASK];
id = task_id - TASK_ADV_TASK;
if (is_valid_player(id) && is_user_alive(id)) {
f_data[ACS_FT_ID] = id;
f_data[ACS_FT_TYPE] = (int:rf_get_user_buyzone(id)) | (any:(get_gametime() <= gf_round_start + rf_get_pcvar_flt(gp_cvar_buytime) * 60.0) << 1);
f_data[ACS_FT_FILTER] = WCS_ADV_TASKS;
f_data[ACS_FT_GIVE_ITEMS] = true;
log_acs("SPAWN TYPE [ %d ]: id = %d, type = %d", get_current_round(), id, f_data[ACS_FT_TYPE]);
acs_check_filter(f_data);
i_count = rf_get_user_weapons(id, _SS(i_weapons));
log_acs("SPAWN POST [ %d ]: id = %d, found %d entities:", get_current_round(), id, i_count);
for (i_i = 0; i_i < i_count; i_i++) {
rf_get_weaponname(i_weapons[i_i], _SC(s_classname));
log_acs("SPAWN POST [ %d ]: id = %d, entity = %d, weapon_class = %s", get_current_round(), id, i_weapons[i_i], s_classname);
acs_add_weapon_limit(id, s_classname);
if (is_custom_weapon(i_weapons[i_i]) && 0 <= (i_key = get_wk(i_weapons[i_i]) - WCS_IMPULSE_OFFSET) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON]);
// SKIP EXT_ & KNIFES FOR *
if (contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX) && !equal(a_weapon[WCS_WEAPON_REFERENCE], "weapon_knife"))
acs_add_weapon_limit(id, ACS_WEAPON_ALL_KEY);
TrieSetCell(gt_weapon_owner, fmt("%d", i_weapons[i_i]), get_user_userid(id));
}
}
if (!is_user_bot(id) &&
(CVAR[VIPMENU_ROUND] <= get_current_round() && (!CVAR[VIPMENU_MODE] || is_nullent(get_member(id, m_rgpPlayerItems, PRIMARY_WEAPON_SLOT)))))
pre_open_menu(id, MENU_BUY);
}
}

public bool:_acs_check_adv_limits2(f_data[ACS_WCS_FILTER_TASK]) {
static i_i, key_limit, limit_id, TeamName:tm_player, l_limit[ACS_WCS_ADV_LIMITS];
new a_limit[ACS_WCS_LIMITS], a_filter[ACS_WCS_AVD_FILTERS];
//f_data[ACS_FT_ERROR][0] = f_data[ACS_FT_REASON][0] = f_data[ACS_FT_SUFFIX][0] = 0;
if (is_valid_player(f_data[ACS_FT_ID]) && is_valid_team(f_data[ACS_FT_ID]) && TrieGetCell(gt_adv_limit, f_data[ACS_FT_NAME], key_limit) && 0 <= key_limit < ArraySize(ga_adv_limits)) {
f_data[ACS_FT_TM_DOMINATE] = acs_get_team_dominate(f_data[ACS_FT_TM_DIFF]);
f_data[ACS_FT_TM_PLAYER] = tm_player;
ArrayGetArray(ga_adv_limits, key_limit, l_limit);
if ((TrieGetCell(gt_weapon_limit, f_data[ACS_FT_NAME], key_limit) && 0 <= key_limit < ArraySize(ga_weapon_limit)))
ArrayGetArray(ga_weapon_limit, key_limit, a_limit);
f_data[ACS_FT_HANDED_PLAYER] = a_limit[HANDED_PLAYER][f_data[ACS_FT_ID]];
f_data[ACS_FT_HANDED_TEAM] = a_limit[HANDED_TEAM][any:tm_player - 1];
f_data[ACS_FT_HANDED_TOTAL] = a_limit[HANDED_TOTAL];
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "AVD_LIMIT2: key = %s, key_limit = %d, player = %d, team = %d, total = %d", f_data[ACS_FT_NAME], key_limit, f_data[ACS_FT_HANDED_PLAYER], f_data[ACS_FT_HANDED_TEAM], f_data[ACS_FT_HANDED_TOTAL]);
for (i_i = 0; i_i < l_limit[WCS_LIMIT_COUNT]; i_i++) {
f_data[ACS_FT_ERROR][0] = f_data[ACS_FT_REASON][0] = f_data[ACS_FT_SUFFIX][0] = 0;
limit_id = l_limit[WCS_LIMIT_ID][i_i];
ArrayGetArray(Array:ga_filters[WCS_ADV_LIMITS], limit_id, a_filter);
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "ADV_LIMIT2: name = %s, limit_players = %d, limit_team = %d, limit_total = %d", a_filter[FILTER_NAME], a_filter[FILTER_LIMIT], a_filter[FILTER_LIMIT_TEAM], a_filter[FILTER_LIMIT_TOTAL]);
if (acs_check_filter_row(a_filter, f_data))
continue;
formatex(_SC(f_data[ACS_FT_SUFFIX]), a_filter[FILTER_NAME]);
if (strlen(f_data[ACS_FT_REASON]) > 2)
format(_SC(f_data[ACS_FT_REASON]), "%s", f_data[ACS_FT_REASON][2]);
return true;
}
}
return false;
}

public bool:acs_check_filter_row(a_filter[ACS_WCS_AVD_FILTERS], f_data[ACS_WCS_FILTER_TASK]) {
static key_limit, a_timer[ACS_TIMER_DATA], a_last_round[ACS_WCS_LAST_ROUND_DATA], Float:f_delay;
new bool:skip_check, i_exp, Float:f_skill, i_reason;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): name = %s", a_filter[FILTER_NAME]);
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_type = %d, type = %d", a_filter[FILTER_TYPE], f_data[ACS_FT_TYPE]);
if (a_filter[FILTER_TYPE] && !(((f_data[ACS_FT_FILTER] == WCS_ADV_EVENTS) && (a_filter[FILTER_TYPE] & f_data[ACS_FT_TYPE])) || ((a_filter[FILTER_TYPE] & f_data[ACS_FT_TYPE]) == a_filter[FILTER_TYPE])))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_flag = %d, flag = %d", a_filter[FILTER_ACCESS_FLAG], get_user_flags(f_data[ACS_FT_ID]));
if (a_filter[FILTER_ACCESS_FLAG] && f_data[ACS_FT_ID] && !check_flags(a_filter[FILTER_ACCESS_FLAG], get_user_flags(f_data[ACS_FT_ID])))
return true;
if (a_filter[FILTER_MAPS][0] && !is_map_located(f_data[ACS_FT_ID], a_filter[FILTER_MAPS]))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_round = %d, round = %d", a_filter[FILTER_ALLOW_ROUNDS], get_current_round());
if (_SFF(a_filter[FILTER_ALLOW_ROUNDS]) && !is_interval_located(a_filter[FILTER_ALLOW_ROUNDS], pack_interval(fmt("%d", get_current_round()))))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_time = %d, time = %s", a_filter[FILTER_TIME], fmt_date("%H:%M"));
if (_SFF2(a_filter[FILTER_TIME]) && !is_interval_located(a_filter[FILTER_TIME], pack_interval(fmt_date("%H:%M"))))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_players_count = %d, players_count = %d", a_filter[FILTER_PLAYERS_COUNT], acs_get_playersnum());
if (_SFF(a_filter[FILTER_PLAYERS_COUNT]) && !is_interval_located(a_filter[FILTER_PLAYERS_COUNT], pack_interval(fmt("%d", acs_get_playersnum()))))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_exp = %d, exp = %d", a_filter[FILTER_EXP], floatround(aes_get_player_exp(f_data[ACS_FT_ID])));
if (_SFF(a_filter[FILTER_EXP]) && _AES_EXIST(f_data[ACS_FT_ID]) && (i_exp = floatround(aes_get_player_exp(f_data[ACS_FT_ID]))) >= 0 && !is_interval_located(a_filter[FILTER_EXP], pack_interval(fmt("%d", i_exp))))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_skill = %d", a_filter[FILTER_SKILL]);
if (_SFF(a_filter[FILTER_SKILL]) && f_data[ACS_FT_ID] && _CSX_EXIST && get_user_skill(f_data[ACS_FT_ID], f_skill) && !is_interval_located(a_filter[FILTER_SKILL], pack_interval(fmt("%d", floatround(f_skill)))))
return true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): filter_domination = %d, diff = %d", a_filter[FILTER_DOMINATION], f_data[ACS_FT_TM_DIFF]);
if (_SFF(a_filter[FILTER_DOMINATION]) && (f_data[ACS_FT_TM_DOMINATE] != f_data[ACS_FT_TM_PLAYER] || !is_interval_located(a_filter[FILTER_DOMINATION], pack_interval(fmt("%d", f_data[ACS_FT_TM_DIFF])))))
return true;
if (f_data[ACS_FT_ID] && TrieGetCell(gt_weapon_last_round, LR_KEY(f_data[ACS_FT_ID], f_data[ACS_FT_NAME]), key_limit)) {
unpack_last_round(key_limit, a_last_round);
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "FILTER: key = %s, last_round = %d, filter_cont = %d, last_cont = %d", LR_KEY(f_data[ACS_FT_ID], f_data[ACS_FT_NAME]), a_last_round[LAST_ROUND], a_filter[FILTER_LIMIT_CONT], a_last_round[LAST_CONT]);
if (_SFF4(a_filter[FILTER_LIMIT_CONT], a_filter[FILTER_LIMIT_CONT_ROUND]) && a_filter[FILTER_LIMIT_CONT] <= a_last_round[LAST_CONT]) {
formatex(_SC(f_data[ACS_FT_ERROR]), "%L", f_data[ACS_FT_ID], fmt("WP_LIMIT_CONT_%d", a_filter[FILTER_LIMIT_CONT_ROUND] > 0), _DII("WP_LIMIT", a_filter[FILTER_LIMIT_CONT]), _DII("WP_ROUND", a_filter[FILTER_LIMIT_CONT_ROUND]));
if (!(a_last_round[LAST_BLOCK] = !(get_current_round() - a_last_round[LAST_ROUND] > a_filter[FILTER_LIMIT_CONT_ROUND]))) // RETRY_COUNT
a_last_round[LAST_CONT] = 0;
else
skip_check = true;
TrieSetCell(gt_weapon_last_round, LR_KEY(f_data[ACS_FT_ID], f_data[ACS_FT_NAME]), pack_last_round(a_last_round));
}
} else
i_reason++;
if (f_data[ACS_FT_ID] && !skip_check && !f_data[ACS_FT_GIVE_ITEMS]) {
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "ADV_LIMIT: limit_handed_player = %d, handed_player = %d", a_filter[FILTER_LIMIT], f_data[ACS_FT_HANDED_PLAYER]);
if (!(_SFF3(a_filter[FILTER_LIMIT]) && a_filter[FILTER_LIMIT] <= f_data[ACS_FT_HANDED_PLAYER])) {
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "ADV_LIMIT: limit_handed_team = %d, handed_team = %d", a_filter[FILTER_LIMIT_TEAM], f_data[ACS_FT_HANDED_TEAM]);
if (!(_SFF3(a_filter[FILTER_LIMIT_TEAM]) && a_filter[FILTER_LIMIT_TEAM] <= f_data[ACS_FT_HANDED_TEAM])) {
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "ADV_LIMIT: limit_handed_player = %d, handed_player = %d", a_filter[FILTER_LIMIT_TOTAL], f_data[ACS_FT_HANDED_TOTAL]);
if (!(_SFF3(a_filter[FILTER_LIMIT_TOTAL]) && a_filter[FILTER_LIMIT_TOTAL] <= f_data[ACS_FT_HANDED_TOTAL]))
return true;
else if (a_filter[FILTER_LIMIT_TOTAL] > 0)
formatex(_SC(f_data[ACS_FT_ERROR]), "%L", f_data[ACS_FT_ID], "WP_LIMIT_TOTAL", _DII("WP_LIMIT", a_filter[FILTER_LIMIT_TOTAL]));
} else if (a_filter[FILTER_LIMIT_TEAM] > 0)
formatex(_SC(f_data[ACS_FT_ERROR]), "%L", f_data[ACS_FT_ID], "WP_LIMIT_TEAM", _DII("WP_LIMIT", a_filter[FILTER_LIMIT_TEAM]));
} else if (a_filter[FILTER_LIMIT] > 0)
formatex(_SC(f_data[ACS_FT_ERROR]), "%L", f_data[ACS_FT_ID], "WP_LIMIT_PLAYER", _DII("WP_LIMIT", a_filter[FILTER_LIMIT]));
if (a_filter[FILTER_LIMIT] < 0 || a_filter[FILTER_LIMIT_TEAM] < 0 || a_filter[FILTER_LIMIT_TOTAL] < 0)
formatex(_SC(f_data[ACS_FT_ERROR]), "%L", f_data[ACS_FT_ID], "WP_LIMIT_BLOCKED");
}
f_data[ACS_FT_SHOW_ERROR] = !(a_filter[FILTER_LIMIT] < -1 || a_filter[FILTER_LIMIT_TEAM] < -1 || a_filter[FILTER_LIMIT_TOTAL] < -1);
copy(_SC(f_data[ACS_FT_ITEMS]), a_filter[FILTER_ITEMS]);
copy(_SC(f_data[ACS_FT_CL_CMDS]), a_filter[FILTER_CL_CMDS]);
copy(_SC(f_data[ACS_FT_SV_CMDS]), a_filter[FILTER_SV_CMDS]);
copy(_SC(f_data[ACS_FT_NATIVE]), a_filter[FILTER_NATIVE]);
//acs_client_print(0, ACS_SHOW_DEBUG, "check_filter(): id = %d, filter_delay = %f", f_data[ACS_FT_ID], a_filter[FILTER_DELAY]);
if (a_filter[FILTER_DELAY] > 0.0) {
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): make task");
if (f_data[ACS_FT_ID] && a_filter[FILTER_ITEMS][0]) {
set_task(a_filter[FILTER_DELAY], "acs_process_filter", TASK_PROCESS + f_data[ACS_FT_ID], _SS(f_data));
} else {
f_delay = a_filter[FILTER_DELAY_RELATIVE] ? rf_get_cvar_flt("mp_roundtime") * 60.0 + rf_get_cvar_flt("mp_freezetime") - a_filter[FILTER_DELAY] - 1.0 : a_filter[FILTER_DELAY];
if (!gb_task_process_delay) {
gb_task_process_delay = true;
set_task(f_delay, "acs_process_filter", TASK_PROCESS, _SS(f_data));
log_acs("SET_TASK_PROCESS_DELAY: id = %d, index = %d, delay = %f, name = %s, items = %s, sv_cmds = %s", f_data[ACS_FT_ID], f_data[ACS_FT_INDEX], a_filter[FILTER_DELAY], f_data[ACS_FT_NAME], f_data[ACS_FT_ITEMS], f_data[ACS_FT_SV_CMDS]);
}
if (!gb_task_timer) {
gb_task_timer = true;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): make timer = %f", a_filter[FILTER_DELAY]);
a_timer[TIMER_VALUE] = a_filter[FILTER_DELAY];
a_timer[TIMER_ID] = TASK_TIMER + 100 * (f_data[ACS_FT_FILTER] - 1) + f_data[ACS_FT_INDEX];
if (a_filter[FILTER_DELAY_RELATIVE])
set_task(f_delay, "task_show_timer", TASK_TIMER, _SS(a_timer));
else
task_show_timer(a_timer);
log_acs("SET_TASK_TIMER: id = %d, index = %d, delay = %f, name = %s, items = %s", f_data[ACS_FT_ID], f_data[ACS_FT_INDEX], a_filter[FILTER_DELAY], f_data[ACS_FT_NAME], f_data[ACS_FT_ITEMS]);
}
}
} else {
if (!a_filter[FILTER_ITEMS][0] && a_filter[FILTER_SV_CMDS][0]) {
if (gb_task_process)
return false;
else
gb_task_process = true;
}
if (a_filter[FILTER_DELAY] < 0.0)
if (TrieGetCell(gt_weapon_groups, fmt(ACS_WCS_WP_GROUP_KEY, f_data[ACS_FT_ID]), key_limit) && key_limit == floatround(a_filter[FILTER_DELAY]))
return false;
else
TrieSetCell(gt_weapon_groups, fmt(ACS_WCS_WP_GROUP_KEY, f_data[ACS_FT_ID]), floatround(a_filter[FILTER_DELAY]));
log_acs("SET_TASK_PROCESS: id = %d, index = %d, name = %s, items = %s, sv_cmds = %s", f_data[ACS_FT_ID], f_data[ACS_FT_INDEX], f_data[ACS_FT_NAME], a_filter[FILTER_ITEMS], f_data[ACS_FT_SV_CMDS]);
acs_process_filter(f_data);
}
return false;
}

public bool:acs_check_filter(f_data[ACS_WCS_FILTER_TASK]) {
static i_i, a_filter[ACS_WCS_AVD_FILTERS];
new bool:b_result, TeamName:tm_player;
if ((!f_data[ACS_FT_ID] || is_valid_player(f_data[ACS_FT_ID]) && is_valid_team(f_data[ACS_FT_ID])) && 0 <= f_data[ACS_FT_FILTER] < ACS_WCS_ADV_FILTER_TYPES) {
//if (is_valid_player(f_data[ACS_FT_ID]) && is_valid_team(f_data[ACS_FT_ID]) && 0 <= f_data[ACS_FT_FILTER] < ACS_WCS_ADV_FILTER_TYPES) {
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "check_filter(): ga_filters[ %d ] = %d", f_data[ACS_FT_FILTER], ArraySize(ga_filters[f_data[ACS_FT_FILTER]]));
f_data[ACS_FT_TM_DOMINATE] = acs_get_team_dominate(f_data[ACS_FT_TM_DIFF]);
f_data[ACS_FT_TM_PLAYER] = tm_player;
for (i_i = 0; i_i < ArraySize(ga_filters[f_data[ACS_FT_FILTER]]); i_i++) {
ArrayGetArray(ga_filters[f_data[ACS_FT_FILTER]], i_i, a_filter);
f_data[ACS_FT_INDEX] = i_i;
if (acs_check_filter_row(a_filter, f_data) || (b_result = f_data[ACS_FT_GIVE_ITEMS])) {
//acs_client_print(0, ACS_SHOW_DEBUG, "b_result = %d", b_result);
continue;
}
b_result = true;
break;
}
}
return b_result;
}

public acs_process_filter(const f_data[ACS_WCS_FILTER_TASK]) {
new bool:result;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "process_filter(): items = %s, cl_cmds = %s, sv_cmds = %s, cl_native = %s", f_data[ACS_FT_ITEMS], f_data[ACS_FT_CL_CMDS], f_data[ACS_FT_SV_CMDS], f_data[ACS_FT_NATIVE]);
if (f_data[ACS_FT_SV_CMDS][0]) {
server_cmd(f_data[ACS_FT_SV_CMDS]);
server_exec();
}
if (!f_data[ACS_FT_ID] || is_valid_player(f_data[ACS_FT_ID])) {
if (f_data[ACS_FT_GIVE_ITEMS] && f_data[ACS_FT_ITEMS][0])
acs_give_items(f_data[ACS_FT_ID], f_data[ACS_FT_ITEMS]);
if (f_data[ACS_FT_CL_CMDS][0])
client_cmd(f_data[ACS_FT_ID], f_data[ACS_FT_CL_CMDS]);
return f_data[ACS_FT_NATIVE][0] ? acs_exec_native(f_data[ACS_FT_ID], f_data[ACS_FT_NATIVE]) : 1;
}
return result;
}

public CBasePlayer_ResetMaxSpeed_Post(const id) {
static Float:f_speed, i_weapon;
if (!gb_freeze_time && is_valid_player(id)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "ResetMaxSpeed_Post(): user_maxspeed = %f, sv_maxspeed = %f", get_user_maxspeed(id), rf_get_cvar_float("sv_maxspeed"));
if (gi_add_speed[id][SPEED_VALUE]) {
f_speed = gi_add_speed[id][SPEED_RELATIVE] ? get_user_maxspeed(id) + float(gi_add_speed[id][SPEED_VALUE]) : float(gi_add_speed[id][SPEED_VALUE]);
f_speed = floatclamp(f_speed, 0.0, float(CVAR[MAX_SPEED]));
if (f_speed > rf_get_pcvar_flt(gp_cvar_maxspeed))
rf_set_pcvar_flt(gp_cvar_maxspeed, f_speed);
set_user_maxspeed(id, f_speed);
} else if (!is_nullent((i_weapon = get_member(id, m_pActiveItem))) && get_ms(i_weapon) > 0.0 && get_user_maxspeed(id) != get_ms(i_weapon)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "user_maxspeed = %f, var_maxspeed = %f, sv_maxspeed = %f", get_user_maxspeed(id), get_ms(i_weapon), get_cvar_float("sv_maxspeed"));
if (get_ms(i_weapon) > rf_get_pcvar_flt(gp_cvar_maxspeed))
rf_set_pcvar_flt(gp_cvar_maxspeed, get_ms(i_weapon));
set_user_maxspeed(id, get_ms(i_weapon));
}
}
}

public CBasePlayer_HasRestrictItem_Pre(const id, const ItemID:item, const ItemRestType:type) {
static s_classname[ACS_MAX_NAME_LENGTH];
if (is_valid_player(id) && 0 <= any:item <= ITEM_NVG) {
switch (item) {
case ITEM_SHIELDGUN: copy(_SC(s_classname), "weapon_shield");
case ITEM_NVG: copy(_SC(s_classname), "weapon_nvg");
default: get_weaponname(any:item, _SC(s_classname));
}
//acs_client_print(id, ACS_SHOW_DEBUG, "HasRestrictItem_Pre(), item = %d, type = %d, classname = %s", item, (1 << any:type), s_classname);
if (acs_show_adv_limits_error(id, (1 << any:type), s_classname, acs_get_weapon_name(id, s_classname))) {
SetHookChainReturn(ATYPE_BOOL, true);
return HC_SUPERCEDE;
}
}
return HC_CONTINUE;
}

public CBasePlayer_AddPlayerItem_Pre(const id, const item) {
static i_key, s_classname[ACS_MAX_NAME_LENGTH], a_weapon[ACS_WCS];
if (CVAR[DYNAMIC_LIMITS] && is_valid_player(id) && !is_nullent(item)) {
get_entvar(item, var_classname, _SC(s_classname));
//acs_client_print(id, ACS_SHOW_DEBUG, "AddPlayerItem(), item = %d, is_custom = %d, classname = %s", item, is_custom_weapon(item), s_classname);
if (is_custom_weapon(item) && 0 <= (i_key = get_wk(item) - WCS_IMPULSE_OFFSET) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON]);
if (a_weapon[WCS_WEAPON_REFERENCE][0])
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON_REFERENCE]);
// SKIP EXT_ & KNIFES FOR *
if (contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX) && !equal(a_weapon[WCS_WEAPON_REFERENCE], "weapon_knife"))
acs_add_weapon_limit(id, ACS_WEAPON_ALL_KEY);
} else
acs_add_weapon_limit(id, s_classname);
}
return HC_CONTINUE;
}

public Touch_Pre(const entity, const id) {
static i_key, i_owner_userid, item, s_key[ACS_MAX_NAME_LENGTH], a_weapon[ACS_WCS];
if (is_valid_player(id) && !is_nullent(entity)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "[WCS] Touch_Pre(), item = %d, wb = %d", item, get_wb(entity));
if(CVAR[PICKUP_ACCESS_TYPE] &&
!((TrieGetCell(gt_weapon_owner, fmt("%d", get_wb(entity)), i_owner_userid) && i_owner_userid == get_user_userid(id)) || !pickup_blocked(entity, id))) {
if(gf_touch_time[id] < get_gametime()) {
acs_client_print(id, ACS_SHOW_NO_ACCESS, "%L", id, "CHAT_NO_ACCESS");
gf_touch_time[id] = get_gametime() + 3.0;
}
return HAM_SUPERCEDE;
}
if (!is_nullent((item = get_wb(entity))) && is_custom_weapon(item) && 0 <= (i_key = get_wk(item) - WCS_IMPULSE_OFFSET) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
formatex(_SC(s_key), "%d", i_key);
if (acs_show_adv_limits_error(id, any:ITEM_TYPE_TOUCHED + 1, s_key, acs_get_weapon_name(id, s_key)))
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}

public CSGameRules_CanHavePlayerItem_Pre(const id, const item) {
/*
ITEM_TYPE_BUYING, // when a player buying items
ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity
ITEM_TYPE_EQUIPPED // when an entity game_player_equip gives item to player or default item's on player spawn
*/
static i_key, s_key[ACS_MAX_NAME_LENGTH], a_weapon[ACS_WCS];
if (is_valid_player(id) && !is_nullent(item)) {
get_entvar(item, var_classname, _SC(s_key));
if (is_custom_weapon(item) && 0 <= (i_key = get_wk(item) - WCS_IMPULSE_OFFSET) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
formatex(_SC(s_key), "%d", i_key);
} else
i_key = -1;
//acs_client_print(id, ACS_SHOW_DEBUG, "CanHavePlayerItem_Pre(), item = %d, key = %s", item, s_key);
//if (i_key >= 0)
// acs_client_print(id, ACS_SHOW_DEBUG, "CanHavePlayerItem_Pre(): id = %d, item = %d, name = %s, clcmds = %s", id, item, a_weapon[WCS_NAME_ITEM], a_weapon[WCS_WEAPON]);
if (acs_show_adv_limits_error(id, any:ITEM_TYPE_BUYING + 1, s_key, acs_get_weapon_name(id, s_key), true)) {
//set_entvar(item, var_owner, 0);
//log_acs("BLOCK ITEM = %d, id = %d", item, id);
// Fix ReGame crazy
if (!gb_block_C4 && acs_get_weapon_info(s_key, WI_ID) == WEAPON_C4)
gb_block_C4 = true;
SetHookChainReturn(ATYPE_INTEGER, 0);
return HC_SUPERCEDE;
}
if (i_key >= 0) {
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON], SELF_ITEM_ADD);
if (a_weapon[WCS_WEAPON_REFERENCE][0])
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON_REFERENCE], SELF_ITEM_ADD);
// SKIP EXT_ & KNIFES FOR *
if (contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX) && !equal(a_weapon[WCS_WEAPON_REFERENCE], "weapon_knife"))
acs_add_weapon_limit(id, ACS_WEAPON_ALL_KEY, SELF_ITEM_ADD);
} else
acs_add_weapon_limit(id, s_key, SELF_ITEM_ADD);

}
return HC_CONTINUE;
}

public task_show_timer(a_timer[ACS_TIMER_DATA]) {
static i_timer, i_timer_id, i_RGB[3], s_color[ACS_MAX_INT_STR_LENGTH], s_RGB[3][ACS_MAX_INT_STR_LENGTH / 3], s_key[ACS_MAX_NAME_LENGTH], s_value[ACS_MAX_NAME_LENGTH];
if (a_timer[TIMER_ID] != i_timer_id) {
i_timer = floatround(a_timer[TIMER_VALUE], floatround_ceil);
i_timer_id = a_timer[TIMER_ID];
formatex(_SC(s_color), "%L", 0, fmt("ACS_WCSTIMER_%d_COLOR", i_timer_id));
if (strfind(s_color, "ML_") != 0) {
replace_all(_SC(s_color), ",", " ");
if (parse(s_color, _SCC(s_RGB, 0), _SCC(s_RGB, 1), _SCC(s_RGB, 2)) == 3) {
i_RGB[0] = str_to_num(s_RGB[0]);
i_RGB[1] = str_to_num(s_RGB[1]);
i_RGB[2] = str_to_num(s_RGB[2]);
}
} else {
i_RGB[0] = 0;
i_RGB[1] = 187;
i_RGB[2] = 227;
}
formatex(_SC(s_key), "%L", 0, fmt("ACS_WCSTIMER_%d", i_timer_id), i_timer);
if (s_key[0]) {
formatex(_SC(s_key), "%L", 0, fmt("ACS_WCSTIMER_%d_VALUE", i_timer_id));
if (strfind(s_key, "ML_") != 0) {
TrieGetString(gt_random_names, s_key, _SC(s_value));
if (!s_value[0]) {
formatex(_SC(s_value), "WP_NAME_%s_EMPTY", s_key);
strtoupper(s_value);
format(_SC(s_value), "%L", 0, s_value);
}
} else
s_key[0] = 0;
} else
i_timer = 0;
}
if (!gb_STOP && i_timer > 0) {
set_hudmessage(_RGB(i_RGB), -1.0, 0.08, 0, 0.0, 2.0, 0.1, 0.2);
switch (s_key[0]) {
case 0: ShowSyncHudMsg(0, gh_hudsync[0/*i_timer_id % sizeof(gh_hudsync)*/], "%L", 0, fmt("ACS_WCSTIMER_%d", i_timer_id), i_timer);
default: ShowSyncHudMsg(0, gh_hudsync[0/*i_timer_id % sizeof(gh_hudsync)*/], "%L", 0, fmt("ACS_WCSTIMER_%d", i_timer_id), s_value, i_timer);
}
set_task(1.0, "task_show_timer", TASK_TIMER, _SS(a_timer));
i_timer--;
} else
i_timer_id = -1;
}

stock bool:acs_show_adv_limits_error(const id, const type, const key[], const weapon_name[], const bool:check_reference = false) {
static bool:b_result;
new f_data[ACS_WCS_FILTER_TASK];
if (is_valid_player(id)) {
f_data[ACS_FT_ID] = id;
f_data[ACS_FT_TYPE] = type;
f_data[ACS_FT_FILTER] = WCS_ADV_LIMITS;
f_data[ACS_FT_GIVE_ITEMS] = false;
copy(_SC(f_data[ACS_FT_NAME]), key);
if ((b_result = acs_check_adv_limits2(f_data, check_reference)) && f_data[ACS_FT_SHOW_ERROR]) {
acs_client_print(id, ACS_SHOW_NO_ACCESS, "%L", id, "CHAT_NO_ACCESS_LIMIT", weapon_name, f_data[ACS_FT_ERROR], "");
acs_client_print(id, ACS_SHOW_NO_ACCESS2, "%L", id, "CHAT_NO_ACCESS_LIMIT_REASON", f_data[ACS_FT_REASON]);
}
}
return b_result;
}

stock bool:acs_check_adv_limits2(f_data[ACS_WCS_FILTER_TASK], const bool:check_reference = false) {
static i_key, a_weapon[ACS_WCS];
if (!is_valid_player(f_data[ACS_FT_ID]))
return false;
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "ACS_ADV_LIMIT: id = %d, key = %s, type = %d", f_data[ACS_FT_ID], f_data[ACS_FT_NAME], f_data[ACS_FT_TYPE]);
if (is_str_num(f_data[ACS_FT_NAME]) && 0 <= (i_key = str_to_num(f_data[ACS_FT_NAME])) < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
copy(_SC(f_data[ACS_FT_NAME]), a_weapon[WCS_WEAPON]);
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "WCS_WEAPON = %s, type = %d", a_weapon[WCS_WEAPON], f_data[ACS_FT_TYPE]);
if (_acs_check_adv_limits2(f_data))
return true;
if (a_weapon[WCS_WEAPON_REFERENCE][0]) {
copy(_SC(f_data[ACS_FT_NAME]), a_weapon[WCS_WEAPON_REFERENCE]);
//acs_client_print(f_data[ACS_FT_ID], ACS_SHOW_DEBUG, "WCS_WEAPON = %s, type = %d", a_weapon[WCS_WEAPON_REFERENCE], f_data[ACS_FT_TYPE]);
if (check_reference && _acs_check_adv_limits2(f_data))
return true;
}
// SKIP EXT_ & KNIFES FOR *
if (contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX) && !equal(a_weapon[WCS_WEAPON_REFERENCE], "weapon_knife")) {
copy(_SC(f_data[ACS_FT_NAME]), ACS_WEAPON_ALL_KEY);
if (_acs_check_adv_limits2(f_data))
return true;
}
} else if (_acs_check_adv_limits2(f_data))
return true;
return false;
}

public cmd_offline_reset(const id, const level, const cid) {
if (cmd_access(id, level, cid, 1)) {
acs_offline(ACS_NVLT_CORE, ACS_OFFLINE_RESET);
if (id)
console_print(id, "%L", id, "CONSOLE_OFFLINE_RESET");
else
server_print("%L", 0, "CONSOLE_OFFLINE_RESET");
}
return PLUGIN_HANDLED;
}

public cmd_round_end(const id, const level, const cid) {
static i_id, Float:f_delay, s_delay[ACS_MAX_INT_STR_LENGTH / 3], s_id[ACS_MAX_INT_STR_LENGTH / 3], s_round_reset[2];
if (cmd_access(id, level, cid, 2)) {
read_argv(1, _SC(s_delay));
read_argv(2, _SC(s_id));
read_argv(3, _SC(s_round_reset));
i_id = clamp(str_to_num(s_id), 0);
f_delay = floatclamp(str_to_float(s_delay), 0.1, 10.0);
if (s_round_reset[0] == '#') {
gi_total_rounds_played = 0;
TrieClear(gt_weapon_last_round);
set_member_game(m_iTotalRoundsPlayed, 0);
}
set_member_game(m_bCompleteReset, true);
rg_round_end(f_delay, WINSTATUS_NONE, ROUND_GAME_RESTART, fmt("%L", id, fmt("ACS_WCSROUND_END_%d", i_id), f_delay), _, true);
log_acs("ROUND END [ %d ] f_delay = %f, m_bGameStarted = %d !!!!", get_current_round(), f_delay, get_member_game(m_bGameStarted));
}
return PLUGIN_HANDLED;
}

public cmd_remove_all_weapons(const id, const level, const cid) {
static i_i;
if (cmd_access(id, level, cid, 1)) {
for (i_i = 1; i_i < MAX_PLAYERS + 1; i_i++)
if (is_valid_player(i_i) && is_user_alive(i_i)) {
rg_remove_all_items(i_i, true);
set_user_maxspeed(i_i, 1.0);
}
}
return PLUGIN_HANDLED;
}

public cmd_show_menu(const id, const level, const cid) {
static i_key, m_data[ACS_WCS_MENU];
if (is_valid_player(id) && is_user_alive(id)) {
if (TrieGetCell(gt_menu_clcmd, D_KEY(cid), i_key) && 0 <= i_key < ArraySize(ga_menu_data)) {
ArrayGetArray(ga_menu_data, i_key, m_data);
if ((!m_data[MENU_ACCESS_FLAGS] || (get_user_flags(id) & m_data[MENU_ACCESS_FLAGS]) ) && m_data[MENU_ALLOW_ROUND] <= get_current_round()) {
pre_open_menu(id, MENU_BUY_1, fmt("%s#%u#%d#%s#%s", m_data[MENU_CLCMDS], m_data[MENU_ACCESS_FLAGS], MENU_BUY_1, m_data[MENU_ITEMS], m_data[MENU_NAME]));
} else
console_print(id, "%L", id, "CONSOLE_NO_ACCESS");
}
}
return PLUGIN_HANDLED;
}

public cmd_menu(const id) {
if (is_valid_player(id) && is_user_alive(id) && !is_user_bot(id) && CVAR[VIPMENU_ROUND] <= get_current_round()) {
// FOR DEVV MODE
if(!((CVAR[VIPMENU_MODE] & 0x2) && acs_has_restrictions(id)))
pre_open_menu(id, MENU_BUY);
}
return PLUGIN_HANDLED;
}

public cmd_damager(const id) {
if (is_valid_player(id) && !is_user_bot(id))
pre_open_menu(id, MENU_OPTIONS_DAMAGER);
return PLUGIN_HANDLED;
}

public cmd_killfader(const id) {
if (is_valid_player(id) && !is_user_bot(id))
pre_open_menu(id, MENU_OPTIONS_KILLFADER);
return PLUGIN_HANDLED;
}

public cmd_wcstest(const id) {
static i_i, i_j;
if (!is_entity_max_count()) {
for (i_i = 1; i_i <= MAX_PLAYERS; i_i++)
for (i_j = 0; i_j < 5; i_j++)
if (is_valid_player(i_i) && is_user_alive(i_i)) {
acs_give_weapon(i_i, 10, CMD_ADMIN);
pre_open_menu(i_i, MENU_BUY);
}
}
return PLUGIN_HANDLED;
}

stock pre_open_menu(const id, const menu_type, const params[] = "") {
static i_i, /*i_tmp[2],*/ h_menu, h_menu_callback, s_wp_clcmds[ACS_MAX_NAME_LENGTH], m_data[ACS_WCS_MENU];
static s_wp_primary[ACS_MAX_NAME_LENGTH], s_wp_secondary[ACS_MAX_NAME_LENGTH];
static s_tmp[ACS_MAX_BUFFER_SIZE], s_value[ACS_MAX_NAME_ML_LENGTH], s_flag[ACS_MAX_FLAG_CHARS], s_step[ACS_MAX_INT_STR_LENGTH], s_items[ACS_MAX_BUFFER_SIZE];
static s_menu_name[ACS_MAX_NAME_ML_LENGTH], s_menu_header[2 * ACS_MAX_BUFFER_SIZE], s_server_name[ACS_MAX_NAME_ML_LENGTH];
static s_authid[MAX_AUTHID_LENGTH], s_md5[33], s_key[ACS_MAX_BUFFER_SIZE], i_opt_index, s_opt_index[ACS_MAX_INT_STR_LENGTH / 2];
static a_mode[ACS_WCS_MODES], a_color[ACS_WCS_COLORS], s_enabled[2];
// wp_clcmds, flag, step, items, selected_name
strtok(params, _SC(s_wp_clcmds), _SC(s_tmp), '#', 0);
strtok(s_wp_clcmds, _SC(s_wp_primary), _SC(s_wp_secondary), '@', 0);
strtok(s_tmp, _SC(s_flag), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_step), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_items), _SC(s_tmp), '#', 0);
formatex(_SC(s_menu_name), "%L", id, fmt("ACS_WCSMENU_%d_NAME", menu_type));
switch (menu_type) {
case MENU_BUY: {
if (CVAR[SERVER_NAME][0]) {
copy(_SC(s_server_name), CVAR[SERVER_NAME]);
}
else
get_user_name(0, _SC(s_server_name));
formatex(_SC(s_menu_header), "%L", id, fmt("ACS_WCSMENU_%d_HEADER%s", menu_type, _GAMECMS_EXIST ? "" : "_WITHOUT_GAMECMS"), s_menu_name, s_server_name, id, gs_gamecms_timeleft[id]);
}
case MENU_BUY_1: {
formatex(_SC(s_menu_header), "%L", id, fmt("ACS_WCSMENU_%d_HEADER%s", menu_type, _AES_EXIST(id) ? "" : "_WITHOUT_AES_BONUS"), s_menu_name, s_tmp, aes_get_player_bonus(id));
}
case MENU_OPTIONS_DAMAGER, MENU_OPTIONS_KILLFADER: {
formatex(_SC(s_menu_header), "%L", id, fmt("ACS_WCSMENU_%d_HEADER", menu_type), s_menu_name);
}
}
h_menu = menu_create(s_menu_header, "acs_menu_cmd");
h_menu_callback = menu_makecallback("acs_menu_callback");
menu_setprop(h_menu, MPROP_EXITNAME, fmt("%L", id, "ACS_WCSMENU_EXITNAME"));
menu_setprop(h_menu, MPROP_BACKNAME, fmt("%L", id, "ACS_WCSMENU_BACKNAME"));
menu_setprop(h_menu, MPROP_NEXTNAME, fmt("%L", id, "ACS_WCSMENU_NEXTNAME"));
switch (menu_type) {
case MENU_BUY:
for (i_i = 0; i_i < ArraySize(ga_menu_data); i_i++) {
ArrayGetArray(ga_menu_data, i_i, m_data);
// wp_clcmds, flag, allow_round, cost, step, items, clcmds, plugin:native
menu_additem(h_menu, m_data[MENU_NAME], fmt("%s#%d#%d#%d#%d#%s#%s#%s", /*s_wp_clcmds*/ "" /*m_data[MENU_ITEMS]*/, m_data[MENU_ACCESS_FLAGS], m_data[MENU_ALLOW_ROUND], 0, menu_type, m_data[MENU_ITEMS], m_data[MENU_CLCMDS], m_data[MENU_NATIVE]), 0, h_menu_callback);
}
case MENU_BUY_1: {
new a_weapon[ACS_WCS], s_data[ACS_WCS_SECONDARY], s_primary[ACS_MAX_BUFFER_SIZE / 2], s_secondary[ACS_MAX_BUFFER_SIZE / 2];
new Array:a_list = ArrayCreate(ACS_WCS_SECONDARY);
hash_string(s_items, Hash_Md5, _SC(s_md5));
get_user_authid(id, _SC(s_authid));
formatex(_SC(s_key), "%s_%s", s_authid, s_md5);
strtok(s_items, _SC(s_primary), _SC(s_secondary), '@', 0);
do {
strtok(s_secondary, _SC(s_data[WCS_SEC_CL_CMDS]), _SC(s_secondary), ',', 0);
ArrayPushArray(a_list, s_data);
} while (s_secondary[0]);
if (ArraySize(a_list) > 0) {
if (!(acs_offline(ACS_NVLT_CORE, ACS_OFFLINE_GET, s_key, _SC(s_opt_index)) && is_str_num(s_opt_index) && 0 <= (i_opt_index = str_to_num(s_opt_index)) < ArraySize(a_list))) {
i_opt_index = 0;
acs_offline(ACS_NVLT_CORE, ACS_OFFLINE_SET, s_key, fmt("%d", i_opt_index));
}
ArrayGetArray(a_list, i_opt_index, s_data);
do {
strtok(s_primary, _SC(s_value), _SC(s_primary), ',', 0);
if (s_value[0] && TrieGetCell(gt_weapon_clcmd, s_value, i_i) && 0 <= i_i < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_i, a_weapon);
// wp_clcmds, flag, allow_round, cost, step, selected_item
menu_additem(h_menu, a_weapon[WCS_NAME_ITEM], fmt("%s@%s#%d#%d#%d#%d#%d", a_weapon[WCS_WEAPON], s_data[WCS_SEC_CL_CMDS], a_weapon[WCS_ACCESS_FLAGS], 0, a_weapon[WCS_COST], menu_type, i_i), 0, h_menu_callback);
}
} while (s_primary[0]);
menu_addblank2(h_menu);
if (s_data[WCS_SEC_CL_CMDS][0]) {
// wp_clcmds, flag, allow_round, cost, step, selected_item
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_CHOOSE_SECONDARY", acs_get_weapon_name(id, s_data[WCS_SEC_CL_CMDS])), fmt("%s#%d#%d#%d#%d#%s#%s", s_data[WCS_SEC_CL_CMDS], 0, 0, 0, menu_type + 1, s_items, s_tmp), 0, h_menu_callback);
}
}
}
case MENU_OPTIONS_DAMAGER: {
if (ArraySize(ga_damager_modes) && ArraySize(ga_damager_colors) && ArraySize(ga_damager_trans)) {
get_user_authid(id, _SC(s_authid));
ArrayGetArray(KF_ROTATOR(ga_damager_modes, KEY_DMG_MODE, 0), a_mode);
formatex(_SC(s_enabled), "%s", i_opt_index < 2 ? "0" : "");
ArrayGetArray(KF_ROTATOR(ga_damager_colors, KEY_DMG_COLOR, 1), a_color);
// wp_clcmds, flag, allow_round, cost, step, selected_item
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_DAMAGER_MENU_MODE", a_mode[MODE_NAME]), ROTATOR_MAIN(0));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_DAMAGER_MENU_COLOR", a_color[C_NAME]), ROTATOR_CHILD(1));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_DAMAGER_MENU_TRANS", int:ArrayGetCell(KF_ROTATOR(ga_damager_trans, KEY_DMG_TRANS, 2))), ROTATOR_CHILD(2));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_DAMAGER_MENU_FADEIN", Float:ArrayGetCell(KF_ROTATOR(ga_damager_fadein, KEY_DMG_FADEIN, 3))), ROTATOR_CHILD(3));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_DAMAGER_MENU_FADEOUT", Float:ArrayGetCell(KF_ROTATOR(ga_damager_fadeout, KEY_DMG_FADEOUT, 4))), ROTATOR_CHILD(4));
}
}
case MENU_OPTIONS_KILLFADER: {
if (ArraySize(ga_killfader_modes) && ArraySize(ga_killfader_colors) && ArraySize(ga_killfader_trans)) {
get_user_authid(id, _SC(s_authid));
ArrayGetArray(KF_ROTATOR(ga_killfader_modes, KEY_KF_MODE, 0), a_mode);
formatex(_SC(s_enabled), "%s", i_opt_index > 0 ? "0" : "");
ArrayGetArray(KF_ROTATOR(ga_killfader_colors, KEY_KF_COLOR, 1), a_color);
// wp_clcmds, flag, allow_round, cost, step, selected_item
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_KILLFADER_MENU_MODE", a_mode[MODE_NAME]), ROTATOR_MAIN(0));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_KILLFADER_MENU_COLOR", a_color[C_NAME]), ROTATOR_CHILD(1));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_KILLFADER_MENU_TRANS", int:ArrayGetCell(KF_ROTATOR(ga_killfader_trans, KEY_KF_TRANS, 2))), ROTATOR_CHILD(2));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_KILLFADER_MENU_FADEIN", Float:ArrayGetCell(KF_ROTATOR(ga_killfader_fadein, KEY_KF_FADEIN, 3))), ROTATOR_CHILD(3));
menu_additem(h_menu, fmt("%L", id, "ACS_WCSMENU_ITEMS_KILLFADER_MENU_FADEOUT", Float:ArrayGetCell(KF_ROTATOR(ga_killfader_fadeout, KEY_KF_FADEOUT, 4))), ROTATOR_CHILD(4));
}
}
}
// FIX ACS_VOTE BLOCK
// ERROR: Plugin called menu_display when item=MENU_EXIT
if (acs_can_show_menu(id)) {
menu_display(id, h_menu);
if (CVAR[VIPMENU_TIMEOUT]) {
menu_control_reset(id);
if (CVAR[VIPMENU_TIMEOUT] > 0) {
g_menu_control[id][MC_MENU_OPEN] = true;
g_menu_control[id][MC_MENU_HANDLE] = h_menu;
g_menu_control[id][MC_MENU_TYPE] = menu_type;
} else
menu_set_timeout(id, h_menu, -CVAR[VIPMENU_TIMEOUT]);
}
//log_acs("[MENU] DISPLAY: id = %d, menu = %d", id, h_menu);
}
}

public acs_menu_cmd(const id, const menu, const item) {
static i_i, i_access, i_callback, s_item_name[ACS_MAX_NAME_ML_LENGTH], s_tmp[ACS_MAX_BUFFER_SIZE];//, i_plugin_id, func_id;
static i_step, s_wp_clcmds[ACS_MAX_NAME_ML_LENGTH], s_flag[ACS_MAX_FLAG_CHARS], s_round[ACS_MAX_INT_STR_LENGTH], s_step[ACS_MAX_INT_STR_LENGTH], s_cost[ACS_MAX_INT_STR_LENGTH];
static s_wp_primary[ACS_MAX_NAME_LENGTH], s_wp_secondary[ACS_MAX_NAME_LENGTH];
static s_items[ACS_MAX_BUFFER_SIZE], s_clcmds[ACS_MAX_NAME_ML_LENGTH];
static i_key_index;
if (is_valid_player(id) && item != MENU_EXIT) {
menu_item_getinfo(menu, item, i_access, _SC(s_tmp), _SC(s_item_name), i_callback);
//log_acs("[WCS] MENU_CMD: id = %d, menu = %d, item = %d, data = %s", id, menu, item, s_tmp);
// wp_clcmds, flag, allow_round, cost, step, items, clcmds, plugin:native
strtok(s_tmp, _SC(s_wp_clcmds), _SC(s_tmp), '#', 0);
strtok(s_wp_clcmds, _SC(s_wp_primary), _SC(s_wp_secondary), '@', 0);
strtok(s_tmp, _SC(s_flag), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_round), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_cost), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_step), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_items), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_clcmds), _SC(s_tmp), '#', 0);
//strtok(s_tmp, _SC(s_plugin), _SC(s_native), ':', 0);
if (is_str_num(s_step)) {
switch ((i_step = str_to_num(s_step))) {
case MENU_BUY: {
if (s_clcmds[0])
client_cmd(id, s_clcmds);
if (s_tmp[0])
acs_exec_native(id, s_tmp);
if (s_items[0])
// wp_clcmds, flag, step, items, selected_name
pre_open_menu(id, i_step + 1, fmt("%s#%s#%d#%s#%s", s_wp_clcmds, s_flag, i_step + 1, s_items, s_item_name));
}
case MENU_BUY_1: {
if (is_str_num(s_items))
acs_give_weapon(id, str_to_num(s_items), CMD_PLAYER);
if (s_wp_secondary[0]) {
if (HAS_WEAPON_PREFIX(s_wp_secondary))
acs_give_item(id, s_wp_secondary);
else if (TrieGetCell(gt_weapon_clcmd, s_wp_secondary, i_i) && 0 <= i_i < ArraySize(ga_weapon_data))
acs_give_weapon(id, i_i, CMD_PLAYER);
}
}
case MENU_BUY_2 : {
new s_authid[MAX_AUTHID_LENGTH], s_md5[33], s_key[ACS_MAX_BUFFER_SIZE];
hash_string(s_items, Hash_Md5, _SC(s_md5));
get_user_authid(id, _SC(s_authid));
formatex(_SC(s_key), "%s_%s", s_authid, s_md5);
if (acs_offline(ACS_NVLT_CORE, ACS_OFFLINE_GET, s_key, s_tmp, charsmax(s_tmp)) && is_str_num(s_tmp))
i_key_index = str_to_num(s_tmp) + 1;
acs_offline(ACS_NVLT_CORE, ACS_OFFLINE_SET, s_key, fmt("%d", i_key_index));
//menu_display(id, menu);
//acs_client_print(id, ACS_SHOW_DEBUG, "S_KEY = %s, INDEX = %d", s_key, i_key_index);
pre_open_menu(id, i_step - 1, fmt("%s#%s#%d#%s#%s", s_wp_clcmds, s_flag, i_step - 1, s_items, s_clcmds /*s_item_name*/ ));
}
case MENU_OPTIONS_DAMAGER:
pre_open_menu(id, i_step, fmt("%s#%s#%d#%s#%s", s_wp_clcmds, s_flag, i_step, s_items, s_item_name));
case MENU_OPTIONS_KILLFADER:
pre_open_menu(id, i_step, fmt("%s#%s#%d#%s#%s", s_wp_clcmds, s_flag, i_step, s_items, s_item_name));
}
}
} else {
menu_destroy(menu);
menu_control_reset(id);
//log_acs("[MENU] DESTROY: id = %d, h_menu = %d", id, menu);
}
}

public menu_control_reset(const id) {
g_menu_control[id][MC_MENU_OPEN] = false;
g_menu_control[id][MC_START_TIMER] = false;
g_menu_control[id][MC_MOVE_START] = 0.0;
remove_task(id + TASK_MENU_TIMEOUT);
}

public acs_menu_callback(const id, const menu, const item) {
static i_cost, ITEM_SUFFIX[ACS_MAX_NAME_LENGTH];
static i_access, i_callback, i_round, s_item_name[ACS_MAX_NAME_ML_LENGTH], s_tmp[ACS_MAX_BUFFER_SIZE];
static s_wp_clcmds[ACS_MAX_NAME_ML_LENGTH], s_flag[ACS_MAX_INT_STR_LENGTH], s_round[ACS_MAX_INT_STR_LENGTH], s_cost[ACS_MAX_INT_STR_LENGTH], s_step[ACS_MAX_INT_STR_LENGTH], s_items[ACS_MAX_BUFFER_SIZE], s_clcmds[ACS_MAX_NAME_ML_LENGTH];
static s_wp_primary[ACS_MAX_NAME_LENGTH], s_wp_secondary[ACS_MAX_NAME_LENGTH], s_wp_name[ACS_MAX_NAME_LENGTH];
new f_data[ACS_WCS_FILTER_TASK];//a_params[ACS_WCS_ADV_LIMIT_PARAMS];
if (!is_valid_player(id))
return ITEM_DISABLED;
menu_item_getinfo(menu, item, i_access, _SC(s_tmp), _SC(s_item_name), i_callback);
copy(_SC(s_wp_name), s_item_name);
log_acs("[WCS] MENU_CALLBACK: id = %d, menu = %d, item = %d, data = %s", id, menu, item, s_tmp);
formatex(_SC(ITEM_SUFFIX), "%L", id, "ACS_WCSMENU_ITEM_SUFFIX");
// wp_clcmds, flag, allow_round, cost, step, items, clcmds, plugin:native
strtok(s_tmp, _SC(s_wp_clcmds), _SC(s_tmp), '#', 0);
strtok(s_wp_clcmds, _SC(s_wp_primary), _SC(s_wp_secondary), '@', 0);
strtok(s_tmp, _SC(s_flag), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_round), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_cost), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_step), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_items), _SC(s_tmp), '#', 0);
strtok(s_tmp, _SC(s_clcmds), _SC(s_tmp), '#', 0);
if (!(s_flag[0] == '0' || (get_user_flags(id) & str_to_num(s_flag))))
return ITEM_DISABLED;
switch (str_to_num(s_step)) {
case MENU_BUY, MENU_BUY_1: {
if (is_str_num(s_items)) {
f_data[ACS_FT_ID] = id;
f_data[ACS_FT_TYPE] = any:ITEM_TYPE_BUYING + 1;
copy(_SC(f_data[ACS_FT_NAME]), s_items);
if (acs_check_adv_limits2(f_data, true)) {
if (strfind(s_item_name, ITEM_SUFFIX) < 0) {
format(_SC(s_item_name), "%s %s", s_item_name, fmt("%L", id, "ACS_WCSMENU_ITEM_SUFFIX_FORMAT", ITEM_SUFFIX, f_data[ACS_FT_SUFFIX]));
menu_item_setname(menu, item, s_item_name);
}
return ITEM_DISABLED;
}
}
if (is_str_num(s_round) && (i_round = str_to_num(s_round)) > get_current_round()) {
if (strfind(s_item_name, ITEM_SUFFIX) < 0) {
format(_SC(s_item_name), "%s %s", s_item_name, fmt("%L", id, "ACS_WCSMENU_ITEM_SUFFIX_FORMAT", ITEM_SUFFIX, fmt("%L", id, "ACS_WCSMENU_ITEM_ROUND_FORMAT", unpack_interval(i_round, INTERVAL_ROUNDS))));
menu_item_setname(menu, item, s_item_name);
}
return ITEM_DISABLED;
}
if ((i_cost = str_to_num(s_cost))) {
if (strfind(s_item_name, ITEM_SUFFIX) < 0) {
format(_SC(s_item_name), "%s %s", s_item_name, fmt("%L", id, "ACS_WCSMENU_ITEM_SUFFIX_FORMAT", ITEM_SUFFIX, i_cost > 0 ? fmt("%L", 0, "ACS_WCSMENU_MONEY_FORMAT", i_cost) : fmt("%L", 0, "ACS_WCSMENU_ANEW_FORMAT", abs(i_cost))));
menu_item_setname(menu, item, s_item_name);
}
if (i_cost > 0) {
if (rg_get_user_money(id) < i_cost)
return ITEM_DISABLED;
} else {
//acs_client_print(id, ACS_SHOW_DEBUG, "MENU_CALLBACK: BONUS = %d, EXP = %f", acs_get_player_bonus(id), acs_get_player_exp(id));
if (!_AES_EXIST(id) || aes_get_player_bonus(id) < abs(i_cost))
return ITEM_DISABLED;
}
}
}
}
return ITEM_ENABLED;
}

public acs_load_cfg(const filename[]) {
static h_file, i_i, i_limit_id, s_key[ACS_MAX_BUFFER_SIZE];
static s_path[MAX_RESOURCE_PATH_LENGTH], s_tmp[8 * ACS_MAX_BUFFER_SIZE];
static s_value[ACS_MAX_INT_STR_LENGTH], s_cont[ACS_MAX_INT_STR_LENGTH / 4], s_cont_round[ACS_MAX_INT_STR_LENGTH / 4];
new a_weapon[ACS_WCS], m_data[ACS_WCS_MENU], l_limit[ACS_WCS_ADV_LIMITS], s_line[ACS_WCS_CFG];
new a_filters[ACS_WCS_AVD_FILTERS];
// DEBUG CONFIG
CVAR[LOG] = 1;
get_configsdir(_SC(s_path));
format(s_path, charsmax(s_path), "%s/%s", s_path, filename);
if ((h_file = fopen(s_path, "rt"))) {
ga_menu_data = ArrayCreate(ACS_WCS_MENU, WCS_MAX_MENU_LINE);
ga_weapon_data = ArrayCreate(ACS_WCS, WCS_MAX_WEAPONS);
ga_weapon_limit = ArrayCreate(ACS_WCS_LIMITS, WCS_MAX_LIMITS);
ga_adv_limits = ArrayCreate(ACS_WCS_ADV_LIMITS, WCS_MAX_ADV_LIMITS);
ga_filters[WCS_ADV_LIMITS] = ArrayCreate(ACS_WCS_AVD_FILTERS, WCS_MAX_FILTERS);
ga_filters[WCS_ADV_TASKS] = ArrayCreate(ACS_WCS_AVD_FILTERS, WCS_MAX_FILTERS);
ga_filters[WCS_ADV_EVENTS] = ArrayCreate(ACS_WCS_AVD_FILTERS, WCS_MAX_FILTERS);
ga_sounds = ArrayCreate(ACS_MAX_BUFFER_SIZE);
gt_weapon_owner = TrieCreate();
gt_weapon_limit = TrieCreate();
gt_adv_limit = TrieCreate(); // => ga_adv_limits(key) => [N] => [arr_limit]
gt_weapon_clcmd = TrieCreate();
gt_weapon_recoil = TrieCreate();
gt_weapon_last_round = TrieCreate();
gt_menu_clcmd = TrieCreate();
gt_random_names = TrieCreate();
gt_weapon_groups = TrieCreate();
gt_sounds = TrieCreate();
while (!feof(h_file) && gi_weapon_count < WCS_MAX_WEAPONS) {
fgets(h_file, s_tmp, charsmax(s_tmp));
replace(s_tmp, charsmax(s_tmp), "^n", "");
trim(s_tmp);
if (is_sound_line(s_tmp)) {
parse(s_tmp[2],
_SC(a_filters[FILTER_NAME]), _SC(a_filters[FILTER_ITEMS])
);
i_i = 0;
do {
strtok(a_filters[FILTER_ITEMS], _SC(s_line[cfg_items]), _SC(a_filters[FILTER_ITEMS]), ',', 0);
if (s_line[cfg_items][0]) {
i_limit_id = ArrayPushString(ga_sounds, s_line[cfg_items]);
format(_SC(s_line[cfg_items]), ACS_WCS_SND_PATH, s_line[cfg_items]);
if (file_exists(fmt("sound/%s", s_line[cfg_items])))
precache_sound(s_line[cfg_items]);
else
acs_set_fail_state("[WCS] Sound not found ^"%s^"", s_line[cfg_items]);
i_i++;
}
} while (a_filters[FILTER_ITEMS][0]);
if (i_i)
TrieSetCell(gt_sounds, a_filters[FILTER_NAME], (i_limit_id << 16) | (i_limit_id - i_i + 1));
continue;
}
if (is_event_line(s_tmp)) {
parse(s_tmp[2],
_SC(a_filters[FILTER_NAME]), _SC(s_line[cfg_type]), _SC(s_line[cfg_access_flag]), _SC(a_filters[FILTER_MAPS]), _SC(s_line[cfg_allow_round]), _SC(s_line[cfg_delay]),
_SC(s_line[cfg_time]), _SC(s_line[cfg_players_count]), _SC(s_line[cfg_exp_skill]), _SC(s_line[cfg_domination]), _SC(a_filters[FILTER_ITEMS]),
_SC(a_filters[FILTER_CL_CMDS]), _SC(a_filters[FILTER_SV_CMDS]), _SC(a_filters[FILTER_NATIVE])
);
log_acs("[WCS] EVENT_NAME = %s, EVENT_TYPE = %s, EVENT_ACCESS_FLAG = %s, EVENT_MAPS = %s, EVENT_ALLOW_ROUND = %s, EVENT_DELAY = %s, EVENT_TIME = %s, EVENT_PLAYERS_COUNT = %s, EVENT_EXP_SKILL = %s, EVENT_DOMINATION = %s, EVENT_ITEMS = %s, EVENT_CL_CMDS = %s, EVENT_SV_CMDS = %s, EVENT_NATIVE = %s",
a_filters[TASK_NAME], s_line[cfg_type], s_line[cfg_access_flag], a_filters[FILTER_MAPS], s_line[cfg_allow_round], s_line[cfg_delay], s_line[cfg_time], s_line[cfg_players_count], s_line[cfg_exp_skill], s_line[cfg_domination], a_filters[FILTER_ITEMS], a_filters[TASK_CL_CMDS], a_filters[TASK_SV_CMDS], a_filters[TASK_NATIVE]
);
a_filters[FILTER_TYPE] = str_to_num(s_line[cfg_type]);
gi_block_send_audio |= a_filters[FILTER_TYPE];
a_filters[FILTER_ACCESS_FLAG] = acs_read_flags(s_line[cfg_access_flag]);
a_filters[FILTER_ALLOW_ROUNDS] = pack_interval(s_line[cfg_allow_round]);
a_filters[FILTER_DELAY] = str_to_float(s_line[cfg_delay]);
a_filters[FILTER_DELAY_RELATIVE] = s_line[cfg_delay][0] == '+';
a_filters[FILTER_TIME] = pack_interval(s_line[cfg_time]);
a_filters[FILTER_PLAYERS_COUNT] = pack_interval(s_line[cfg_players_count]);
strtok(s_line[cfg_exp_skill], _SC(s_line[cfg_exp]), _SC(s_line[cfg_skill]), ':', 0);
a_filters[FILTER_EXP] = pack_interval(s_line[cfg_exp]);
a_filters[FILTER_SKILL] = pack_interval(s_line[cfg_skill]);
a_filters[FILTER_DOMINATION] = pack_interval(s_line[cfg_domination]);
a_filters[FILTER_LIMIT] = a_filters[FILTER_LIMIT_TEAM] = a_filters[FILTER_LIMIT_TOTAL] = 0;
ArrayPushArray(Array:ga_filters[WCS_ADV_EVENTS], a_filters);
continue;
}
if (is_task_line(s_tmp)) {
parse(s_tmp[2],
_SC(a_filters[FILTER_NAME]), _SC(s_line[cfg_type]), _SC(s_line[cfg_access_flag]), _SC(a_filters[FILTER_MAPS]), _SC(s_line[cfg_allow_round]), _SC(s_line[cfg_delay]),
_SC(s_line[cfg_time]), _SC(s_line[cfg_players_count]), _SC(s_line[cfg_exp_skill]), _SC(s_line[cfg_domination]), _SC(a_filters[FILTER_ITEMS]),
_SC(a_filters[FILTER_CL_CMDS]), _SC(a_filters[FILTER_SV_CMDS]), _SC(a_filters[FILTER_NATIVE])
);
log_acs("[WCS] TASK_NAME = %s, TASK_TYPE = %s, TASK_ACCESS_FLAG = %s, TASK_MAPS = %s, TASK_ALLOW_ROUND = %s, TASK_DELAY = %s, TASK_TIME = %s, TASK_PLAYERS_COUNT = %s, TASK_EXP_SKILL = %s, TASK_DOMINATION = %s, TASK_ITEMS = %s, TASK_CL_CMDS = %s, TASK_SV_CMDS = %s, TASK_NATIVE = %s",
a_filters[FILTER_NAME], s_line[cfg_type], s_line[cfg_access_flag], a_filters[FILTER_MAPS], s_line[cfg_allow_round], s_line[cfg_delay], s_line[cfg_time], s_line[cfg_players_count], s_line[cfg_exp_skill], s_line[cfg_domination], a_filters[FILTER_ITEMS], a_filters[FILTER_CL_CMDS], a_filters[FILTER_SV_CMDS], a_filters[FILTER_NATIVE]
);
a_filters[FILTER_TYPE] = str_to_num(s_line[cfg_type]);
a_filters[FILTER_ACCESS_FLAG] = acs_read_flags(s_line[cfg_access_flag]);
a_filters[FILTER_ALLOW_ROUNDS] = pack_interval(s_line[cfg_allow_round]);
a_filters[FILTER_DELAY] = str_to_float(s_line[cfg_delay]);
a_filters[FILTER_DELAY_RELATIVE] = s_line[cfg_delay][0] == '+';
a_filters[FILTER_TIME] = pack_interval(s_line[cfg_time]);
a_filters[FILTER_PLAYERS_COUNT] = pack_interval(s_line[cfg_players_count]);
strtok(s_line[cfg_exp_skill], _SC(s_line[cfg_exp]), _SC(s_line[cfg_skill]), ':', 0);
a_filters[FILTER_EXP] = pack_interval(s_line[cfg_exp]);
a_filters[FILTER_SKILL] = pack_interval(s_line[cfg_skill]);
a_filters[FILTER_DOMINATION] = pack_interval(s_line[cfg_domination]);
a_filters[FILTER_LIMIT] = a_filters[FILTER_LIMIT_TEAM] = a_filters[FILTER_LIMIT_TOTAL] = 0;
acs_parse_items(_SC(a_filters[FILTER_ITEMS]));
ArrayPushArray(Array:ga_filters[WCS_ADV_TASKS], a_filters);
continue;
}
if (is_adv_limit_line(s_tmp)) {
parse(s_tmp[2],
_SC(a_filters[FILTER_NAME]), _SC(s_line[cfg_type]), _SC(s_line[cfg_access_flag]), _SC(a_filters[FILTER_MAPS]), _SC(s_line[cfg_allow_round]),
_SC(s_line[cfg_time]), _SC(s_line[cfg_players_count]), _SC(s_line[cfg_exp_skill]), _SC(s_line[cfg_domination]),
_SC(s_line[cfg_limit]), _SC(s_line[cfg_limit_team]), _SC(s_line[cfg_limit_total]), _SC(s_line[cfg_items]),
_SC(a_filters[FILTER_CL_CMDS]), _SC(a_filters[FILTER_NATIVE])
);
log_acs("[WCS] ADV_NAME = %s, ADV_TYPE = %s, ADV_ACCESS_FLAG = %s, ADV_MAPS = %s, ADV_ALLOW_ROUND = %s, ADV_TIME = %s, ADV_PLAYERS_COUNT = %s, ADV_EXP_SKILL = %s, ADV_DOMINATION = %s, ADV_LIMIT = %s, ADV_LIMIT_TEAM = %s, ADV_LIMIT_TOTAL = %s, ADV_ITEMS = %s, ADV_CL_CMDS = %s, ADV_NATIVE = %s",
a_filters[FILTER_NAME], s_line[cfg_type], s_line[cfg_access_flag], a_filters[FILTER_MAPS], s_line[cfg_allow_round], s_line[cfg_time], s_line[cfg_players_count], s_line[cfg_exp_skill], s_line[cfg_domination], s_line[cfg_limit], s_line[cfg_limit_team], s_line[cfg_limit_total], s_line[cfg_items], a_filters[FILTER_CL_CMDS], a_filters[FILTER_NATIVE]
);
a_filters[FILTER_TYPE] = str_to_num(s_line[cfg_type]);
a_filters[FILTER_ACCESS_FLAG] = acs_read_flags(s_line[cfg_access_flag]);
a_filters[FILTER_ALLOW_ROUNDS] = pack_interval(s_line[cfg_allow_round]);
a_filters[FILTER_DELAY] = 0.0;
a_filters[FILTER_DELAY_RELATIVE] = false;
a_filters[FILTER_TIME] = pack_interval(s_line[cfg_time]);
a_filters[FILTER_PLAYERS_COUNT] = pack_interval(s_line[cfg_players_count]);
strtok(s_line[cfg_exp_skill], _SC(s_line[cfg_exp]), _SC(s_line[cfg_skill]), ':', 0);
a_filters[FILTER_EXP] = pack_interval(s_line[cfg_exp]);
a_filters[FILTER_SKILL] = pack_interval(s_line[cfg_skill]);
a_filters[FILTER_DOMINATION] = pack_interval(s_line[cfg_domination]);
strtok(s_line[cfg_limit], _SC(s_value), _SC(s_line[cfg_limit]), ':', 0);
strtok(s_line[cfg_limit], _SC(s_cont), _SC(s_cont_round), ':', 0);
a_filters[FILTER_LIMIT] = str_to_num(s_value);
a_filters[FILTER_LIMIT_CONT] = a_filters[FILTER_LIMIT] >= 0 ? str_to_num(s_cont) : 0;
a_filters[FILTER_LIMIT_CONT_ROUND] = a_filters[FILTER_LIMIT] >= 0 ? str_to_num(s_cont_round) : 0;
a_filters[FILTER_LIMIT_TEAM] = str_to_num(s_line[cfg_limit_team]);
a_filters[FILTER_LIMIT_TOTAL] = str_to_num(s_line[cfg_limit_total]);
i_limit_id = ArrayPushArray(Array:ga_filters[WCS_ADV_LIMITS], a_filters);
do {
strtok(s_line[cfg_items], _SC(s_key), _SC(s_line[cfg_items]), ',', 0);
if (!s_key[0])
continue; //copy(_SC(s_key), ACS_WEAPON_ALL_KEY);
if (TrieGetCell(gt_adv_limit, s_key, i_i) && 0 <= i_i < ArraySize(ga_adv_limits)) {
ArrayGetArray(ga_adv_limits, i_i, l_limit);
if (l_limit[WCS_LIMIT_COUNT] < WCS_MAX_ADV_LIMITS) {
l_limit[WCS_LIMIT_ID][l_limit[WCS_LIMIT_COUNT]] = i_limit_id;
l_limit[WCS_LIMIT_COUNT]++;
ArraySetArray(ga_adv_limits, i_i, l_limit);
} else
log_acs("[WCS] MAX_ADV_LIMITS reached!");
} else {
l_limit[WCS_LIMIT_ID][0] = i_limit_id;
l_limit[WCS_LIMIT_COUNT] = 1;
TrieSetCell(gt_adv_limit, s_key, (i_i = ArrayPushArray(ga_adv_limits, l_limit)));
}
log_acs("[WCS] ADV_LIMITS [ %s ] => [%d][%d] => %s (%d)", s_key, i_i, l_limit[WCS_LIMIT_COUNT] - 1, a_filters[FILTER_NAME], l_limit[WCS_LIMIT_COUNT]);
} while (s_line[cfg_items][0]);
continue;
}
if (is_menu_line(s_tmp)) {
parse(s_tmp[2],
_SC(m_data[MENU_NAME]), _SC(s_line[cfg_allow_round]), _SC(s_line[cfg_access_flag]),
_SC(m_data[MENU_ITEMS]), _SC(m_data[MENU_CLCMDS]), _SC(m_data[MENU_NATIVE])
);
log_acs("[WCS] MENU_NAME = %s, MENU_ALLOW_ROUND = %s, MENU_ACCESS_FLAG = %s, MENU_ITEMS = %s",
m_data[MENU_NAME], s_line[cfg_allow_round], s_line[cfg_access_flag], m_data[MENU_ITEMS]
);
m_data[MENU_ALLOW_ROUND] = str_to_num(s_line[cfg_allow_round]);
m_data[MENU_ACCESS_FLAGS] = acs_read_flags(s_line[cfg_access_flag]);
i_i = ArrayPushArray(ga_menu_data, m_data);
if (m_data[MENU_ITEMS][0] && m_data[MENU_CLCMDS][0]) {
TrieSetCell(gt_menu_clcmd, D_KEY(register_clcmd(m_data[MENU_CLCMDS], "cmd_show_menu")), i_i);
TrieSetCell(gt_menu_clcmd, D_KEY(register_clcmd(fmt("say %s", m_data[MENU_CLCMDS]), "cmd_show_menu")), i_i);
}
continue;
}
if (is_ext_weapon_line(s_tmp)) {
parse(s_tmp[2],
_SC(a_weapon[WCS_WEAPON]), _SC(a_weapon[WCS_NAME_ITEM]), _SC(s_line[cfg_access_flag]),
_SC(s_line[cfg_menu_add]), _SC(s_line[cfg_cost]), _SC(a_weapon[WCS_CL_CMDS]), _SC(a_weapon[WCS_NATIVE])
);
log_acs("[WCS] EXT_WEAPON = %s, EXT_MENU_NAME = %s, EXT_MENU_ACCESS_FLAG = %s, EXT_MENU_ADD = %s, EXT_COST = %s, EXT_CL_CMDS = %s, EXT_NATIVE = %s",
a_weapon[WCS_WEAPON], a_weapon[WCS_NAME_ITEM], s_line[cfg_access_flag], s_line[cfg_menu_add], s_line[cfg_cost], a_weapon[WCS_CL_CMDS], a_weapon[WCS_NATIVE]
);
a_weapon[WCS_ACCESS_FLAGS] = acs_read_flags(s_line[cfg_access_flag]);
a_weapon[WCS_MENU_ADD] = str_to_num(s_line[cfg_menu_add]);
a_weapon[WCS_COST] = str_to_num(s_line[cfg_cost]);
a_weapon[WCS_WEAPON_REFERENCE][0] =
a_weapon[WCS_MAXSPEED][0] =
a_weapon[WCS_MODEL_VIEW][0] =
a_weapon[WCS_MODEL_PLAYER][0] =
a_weapon[WCS_MODEL_WORLD][0] =
a_weapon[WCS_PICKUP_FLAGS] =
a_weapon[WCS_AMMO] =
a_weapon[WCS_BP_AMMO] =
a_weapon[WCS_TRACE] = 0;
a_weapon[WCS_WEAPON_ID] = WEAPON_NONE;
a_weapon[WCS_WEAPON_SLOT] = NONE_SLOT;
a_weapon[WCS_DAMAGE] =
a_weapon[WCS_DISTANCE] =
a_weapon[WCS_RECOIL] = 0.0
TrieSetCell(gt_weapon_clcmd, a_weapon[WCS_WEAPON], ArrayPushArray(ga_weapon_data, a_weapon));
TrieSetCell(gt_weapon_clcmd, WP_KEY(register_clcmd(a_weapon[WCS_WEAPON], "cmd_give_weapon_ex")), gi_weapon_count);
gi_weapon_count++;
continue;
}
if (is_comment_line(s_tmp))
continue;
parse(s_tmp,
_SC(a_weapon[WCS_WEAPON_REFERENCE]), _SC(a_weapon[WCS_WEAPON]), _SC(a_weapon[WCS_NAME_ITEM]), _SC(s_line[cfg_cost]),
_SC(s_line[cfg_ammo]), _SC(s_line[cfg_bp_ammo]), _SC(s_line[cfg_damage]), _SC(s_line[cfg_recoil]), _SC(a_weapon[WCS_MAXSPEED]),
_SC(s_line[cfg_trace]), _SC(s_line[cfg_menu_add]), _SC(s_line[cfg_access_flag]), _SC(s_line[cfg_pickup_flag]),
_SC(a_weapon[WCS_MODEL_VIEW]), _SC(a_weapon[WCS_MODEL_PLAYER]), _SC(a_weapon[WCS_MODEL_WORLD])
);
log_acs("[WCS] WEAPON_REFERENCE = %s, WEAPON_CLCMD = %s, WAPON_MENU_NAME = %s, WEAPON_COST = %s, WEAPON_AMMO = %s, WEAPON_BPAMMO = %s, WEAPON_DAMAGE_DISTANCE = %s, WEAPON_RECOIL = %s, WEAPON_MAXSPEED = %s, WEAPON_TRACE = %s, WEAPON_MENU_ADD = %s, WEAPON_FLAG = %s, WEAPON_FLAG2 = %s, WEAPON_VIEW = %s, WEAPON_PLAYER = %s, WEAPON_WORLD = %s",
a_weapon[WCS_WEAPON_REFERENCE], a_weapon[WCS_WEAPON], a_weapon[WCS_NAME_ITEM], s_line[cfg_cost], s_line[cfg_ammo], s_line[cfg_bp_ammo], s_line[cfg_damage], s_line[cfg_recoil], a_weapon[WCS_MAXSPEED], s_line[cfg_trace], s_line[cfg_menu_add], s_line[cfg_access_flag], s_line[cfg_pickup_flag], a_weapon[WCS_MODEL_VIEW], a_weapon[WCS_MODEL_PLAYER], a_weapon[WCS_MODEL_WORLD]
);
if (a_weapon[WCS_MODEL_VIEW][0]) {
if (!file_exists(a_weapon[WCS_MODEL_VIEW]))
acs_set_fail_state("[WCS] Model not found ^"%s^"", a_weapon[WCS_MODEL_VIEW]);
else
precache_model(a_weapon[WCS_MODEL_VIEW]);
}
if (a_weapon[WCS_MODEL_PLAYER][0]) {
if (!file_exists(a_weapon[WCS_MODEL_PLAYER]))
acs_set_fail_state("[WCS] Model not found ^"%s^"", a_weapon[WCS_MODEL_PLAYER]);
else
precache_model(a_weapon[WCS_MODEL_PLAYER]);
}
if (a_weapon[WCS_MODEL_WORLD][0]) {
if (!file_exists(a_weapon[WCS_MODEL_WORLD]))
acs_set_fail_state("[WCS] Model not found ^"%s^"", a_weapon[WCS_MODEL_WORLD]);
else
precache_model(a_weapon[WCS_MODEL_WORLD]);
}
a_weapon[WCS_ACCESS_FLAGS] = acs_read_flags(s_line[cfg_access_flag]);
a_weapon[WCS_PICKUP_FLAGS] = acs_read_flags(s_line[cfg_pickup_flag]);
if((a_weapon[WCS_WEAPON_ID] = acs_get_weapon_info(a_weapon[WCS_WEAPON_REFERENCE], WI_ID)) == WEAPON_NONE)
acs_set_fail_state("[WCS] Invalid weapon classname ^"%s^"", a_weapon[WCS_WEAPON_REFERENCE]);
a_weapon[WCS_COST] = str_to_num(s_line[cfg_cost]);
a_weapon[WCS_AMMO] = str_to_num(s_line[cfg_ammo]);
a_weapon[WCS_BP_AMMO] = str_to_num(s_line[cfg_bp_ammo]);
a_weapon[WCS_DAMAGE] = str_to_float(s_line[cfg_damage]);
a_weapon[WCS_RECOIL] = s_line[cfg_recoil][0] ? str_to_float(s_line[cfg_recoil]) : 1.0;
a_weapon[WCS_TRACE] = str_to_num(s_line[cfg_trace]);
a_weapon[WCS_MENU_ADD] = str_to_num(s_line[cfg_menu_add]);
a_weapon[WCS_CL_CMDS][0] =
a_weapon[WCS_NATIVE][0] = 0;
TrieSetCell(gt_weapon_clcmd, a_weapon[WCS_WEAPON], ArrayPushArray(ga_weapon_data, a_weapon));
TrieSetCell(gt_weapon_clcmd, WP_KEY(register_clcmd(a_weapon[WCS_WEAPON], "cmd_give_weapon_ex")), gi_weapon_count);
gi_weapon_count++;
}
fclose(h_file);
} else
acs_set_fail_state("[WCS] File not found ^"%s^"", s_path);
}

public CBasePlayerWeapon_PrimaryAttack_Post(const entity) {
static i_player, Float:f_recoil, Float:fv_punch_angle[3];
if (!is_nullent(entity) && is_custom_weapon(entity) && (f_recoil = get_wr(entity)) < 1.0 && (i_player = get_member(entity, m_pPlayer))) {
get_entvar(i_player, var_punchangle, fv_punch_angle);
fv_punch_angle[0] *= f_recoil;
fv_punch_angle[1] *= f_recoil;
fv_punch_angle[2] *= f_recoil;
set_entvar(i_player, var_punchangle, fv_punch_angle);
}
}

public CWeaponBox_SetModel_Pre(const entity, view_model[]) {
static i_weapon, s_world[MAX_RESOURCE_PATH_LENGTH];
if(!is_nullent(entity) && !is_nullent((i_weapon = get_wb(entity))) && is_custom_weapon(i_weapon)) {
get_wmw(i_weapon, s_world);
if(s_world[0])
SetHookChainArg(2, ATYPE_STRING, s_world);
set_wk(entity, get_wk(i_weapon));
set_cw(entity, get_wk(i_weapon));
set_wr(entity, get_wr(i_weapon));
set_wt(entity, get_wt(i_weapon));
set_wf(entity, get_wf(i_weapon));
set_wf2(entity, get_wf2(i_weapon));
set_ms(entity, get_ms(i_weapon));
}
return HC_CONTINUE;
}

public CSGameRules_DeadPlayerWeapons_Pre(const id) {
//acs_client_print(id, ACS_SHOW_DEBUG, "round_infinite = %d", gb_round_infinite);
if (gb_round_infinite || is_entity_max_count()) {
SetHookChainReturn(ATYPE_INTEGER, GR_PLR_DROP_GUN_NO);
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}

public CBasePlayerWeapon_DefaultDeploy_Pre(const entity, view_model[], weapon_model[], anim, anim_ext[], skip_local) {
static s_view[MAX_RESOURCE_PATH_LENGTH], s_player[MAX_RESOURCE_PATH_LENGTH];
if(!is_nullent(entity) && is_custom_weapon(entity)) {
get_wmv(entity, s_view);
get_wmp(entity, s_player);
if (s_view[0])
SetHookChainArg(2, ATYPE_STRING, s_view);
if (s_player[0])
SetHookChainArg(3, ATYPE_STRING, s_player);
}
return HC_CONTINUE;
}

public TraceAttack_Post(const victim, killer, Float:damage, Float:v_direction[3], trace, bits_damage) {
static i_entity, Float:vec_end_pos[3], Float:vec_origin[3];
if (is_valid_player(killer)) {
i_entity = get_member(killer, m_pActiveItem);
if(!is_nullent(i_entity) && get_member(i_entity, m_iId) != WEAPON_KNIFE && is_custom_weapon(i_entity) && get_wt(i_entity)) {
get_tr2(trace, TR_vecEndPos, vec_end_pos);
if(CVAR[TRACE_TYPE] && gh_lazer_beam) {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
{
write_byte(TE_BEAMENTPOINT);
write_short(killer | 0x1000);
engfunc(EngFunc_WriteCoord, vec_end_pos[0]);
engfunc(EngFunc_WriteCoord, vec_end_pos[1]);
engfunc(EngFunc_WriteCoord, vec_end_pos[2]);
write_short(gh_lazer_beam);
write_byte(0);
write_byte(0);
write_byte(1);
write_byte(10);
write_byte(0);
write_byte(255); // R
write_byte(215); // G
write_byte(0); // B
write_byte(200); // A
write_byte(255);
}
message_end();
} else {
get_entvar(killer, var_origin, vec_origin);
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
{
write_byte(TE_TRACER);
engfunc(EngFunc_WriteCoord, vec_origin[0]);
engfunc(EngFunc_WriteCoord, vec_origin[1]);
engfunc(EngFunc_WriteCoord, vec_origin[2]);
engfunc(EngFunc_WriteCoord, vec_end_pos[0]);
engfunc(EngFunc_WriteCoord, vec_end_pos[1]);
engfunc(EngFunc_WriteCoord, vec_end_pos[2]);
}
message_end();
}
}
}
}

public cmd_give_weapon(const id) {
static i_player, i_key, a_weapon[ACS_WCS];
static s_target[ACS_MAX_NAME_LENGTH], s_param[ACS_MAX_NAME_LENGTH];
console_print(id, "give() =>");
if (is_valid_player(id)) {
console_print(id, "valid player!");
if ((get_user_flags(id) & read_flags(CVAR[CMD_ACCESS]))) {
read_argv(1, _SC(s_target));
read_argv(2, _SC(s_param));
if (s_param[0] && s_target[0] && (i_player = cmd_target(id, s_target, CMDTARGET_ALLOW_SELF)) && get_bit(gi_client_connected, i_player)) {
if (TrieGetCell(gt_weapon_clcmd, s_param, i_key)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
if (a_weapon[WCS_MENU_ADD])
acs_give_weapon(i_player, i_key, CMD_ADMIN);
} else
console_print(id, "%L", id, "CONSOLE_WEAPONS_NOTFOUND");
} else
console_print(id, "%L", id, "CONSOLE_USAGE");
} else
console_print(id, "%L", id, "CONSOLE_NO_ACCESS");
}
return PLUGIN_HANDLED;
}

public cmd_give_weapon_ex(const id, const level, const cid) {
static i_key;
if (is_valid_player(id)) {
if (TrieGetCell(gt_weapon_clcmd, WP_KEY(cid), i_key)) {
//log_acs("[WCS] cid = %u, weapon_key = %s, key = %d", cid, WP_KEY(cid), i_key);
if (get_user_flags(id) & read_flags(CVAR[CMD_ACCESS]))
acs_give_weapon(id, i_key, CMD_PLAYER);
else
console_print(id, "%L", id, "CONSOLE_NO_ACCESS");
}
}
return PLUGIN_HANDLED;
}

stock acs_add_weapon_limit(const id, const key[], const bool:is_item_add = false, const add_value = 1) {
static key_limit, TeamName:tm_player;
new a_limit[ACS_WCS_LIMITS], a_last_round[ACS_WCS_LAST_ROUND_DATA];
if (is_valid_player(id) && is_valid_team(id)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "weapon_limit(): key = %s", key);
if ((TrieGetCell(gt_weapon_limit, key, key_limit) && 0 <= key_limit < ArraySize(ga_weapon_limit)))
ArrayGetArray(ga_weapon_limit, key_limit, a_limit);
else if (add_value < 0)
return;
else
key_limit = -1;
if (is_item_add)
a_limit[HANDED_PLAYER][id] += add_value;
if (!(is_item_add && CVAR[DYNAMIC_LIMITS])) {
a_limit[HANDED_TEAM][any:tm_player - 1] += add_value;
a_limit[HANDED_TOTAL] += add_value;
}
//acs_client_print(id, ACS_SHOW_DEBUG, "weapon_limit(): key = %s, key_limit = %d, handed_player = %d, handed_team = %d, handed_total = %d, is_add = %d", key, key_limit, a_limit[HANDED_PLAYER][id], a_limit[HANDED_TEAM][any:tm_player - 1], a_limit[HANDED_TOTAL], is_item_add);
if (key_limit >= 0)
ArraySetArray(ga_weapon_limit, key_limit, a_limit);
else
TrieSetCell(gt_weapon_limit, key, ArrayPushArray(ga_weapon_limit, a_limit));
if (add_value > 0 && !equal(key, ACS_WEAPON_ALL_KEY)) {
if (TrieGetCell(gt_weapon_last_round, LR_KEY(id, key), key_limit))
unpack_last_round(key_limit, a_last_round);
if (a_last_round[LAST_ROUND] && a_last_round[LAST_ROUND] == get_current_round() - 1)
a_last_round[LAST_CONT]++;
else //if (a_last_round[LAST_ROUND] == get_current_round())
a_last_round[LAST_CONT] = 1;
a_last_round[LAST_ROUND] = get_current_round();
//acs_client_print(id, ACS_SHOW_DEBUG, "key = %s, last_round = %d, last_cont = %d", LR_KEY(id, key), a_last_round[LAST_ROUND], a_last_round[LAST_CONT]);
TrieSetCell(gt_weapon_last_round, LR_KEY(id, key), pack_last_round(a_last_round))
}
}
}

stock bool:acs_give_weapon(id, key, ACS_WCS_CMD_TYPES:cmd_type, bool:show_notification = true) {
static a_weapon[ACS_WCS], Float:f_maxspeed;
static i_cost, i_entity, Float:vec_origin[3], i_owner;
new f_data[ACS_WCS_FILTER_TASK];
if (is_valid_player(id) && 0 <= key <= ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, key, a_weapon);
i_cost = 0;
if (is_purchase) {
i_cost = CVAR[DISCOUNT] > 0 ? a_weapon[WCS_COST] * (100 - CVAR[DISCOUNT]) / 100 : a_weapon[WCS_COST];
if (acs_has_restrictions(id, a_weapon[WCS_ACCESS_FLAGS], i_cost))
return false;
}
if (acs_show_adv_limits_error(id, any:ITEM_TYPE_BUYING + 1, fmt("%d", key), a_weapon[WCS_NAME_ITEM], true))
return false;
if (!contain(a_weapon[WCS_WEAPON], ACS_WCS_EXT_PREFIX)) {
//acs_client_print(id, ACS_SHOW_DEBUG, "GIVE_EXT: ID = %d, WEAPON = %s, CL_CMD = %d, NATIVE = %s", key, a_weapon[WCS_WEAPON], a_weapon[WCS_CL_CMDS], a_weapon[WCS_NATIVE]);
f_data[ACS_FT_ID] = id;
copy(_SC(f_data[ACS_FT_CL_CMDS]), a_weapon[WCS_CL_CMDS]);
copy(_SC(f_data[ACS_FT_NATIVE]), a_weapon[WCS_NATIVE]);
if (acs_process_filter(f_data) > 0) {
acs_add_weapon_limit(id, a_weapon[WCS_WEAPON], SELF_ITEM_ADD);
acs_pay_off(id, i_cost, a_weapon[WCS_NAME_ITEM], show_notification, is_purchase);
return true;
}
return false;
}
i_entity = acs_create_entity(a_weapon[WCS_WEAPON_REFERENCE]);
log_acs("ENT CREATE = %d, is_nullent = %d", i_entity, is_nullent(i_entity));
if (!is_nullent((i_entity))) {
get_entvar(id, var_origin, vec_origin);
set_entvar(i_entity, var_origin, vec_origin);
set_wk(i_entity, key + WCS_IMPULSE_OFFSET);
set_cw(i_entity, key + WCS_IMPULSE_OFFSET);
set_wmv(i_entity, a_weapon[WCS_MODEL_VIEW]);
set_wmw(i_entity, a_weapon[WCS_MODEL_WORLD]);
set_wmp(i_entity, a_weapon[WCS_MODEL_PLAYER]);
set_wt(i_entity, a_weapon[WCS_TRACE]);
set_wf(i_entity, a_weapon[WCS_ACCESS_FLAGS]);
set_wf2(i_entity, a_weapon[WCS_PICKUP_FLAGS]);
set_wr(i_entity, a_weapon[WCS_RECOIL]);
if (a_weapon[WCS_MAXSPEED][0]) {
//acs_client_print(id, ACS_SHOW_DEBUG, "[MAX_SPEED] = %s, curr_speed = %f", a_weapon[WCS_MAXSPEED], get_ms(i_entity));
if ((f_maxspeed = a_weapon[WCS_MAXSPEED][0] == '+' || a_weapon[WCS_MAXSPEED][0] == '-' ? get_ms(i_entity) + str_to_float(a_weapon[WCS_MAXSPEED]) : str_to_float(a_weapon[WCS_MAXSPEED])) > 0.0)
set_ms(i_entity, f_maxspeed);
}
set_entvar(i_entity, var_spawnflags, get_entvar(i_entity, var_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, i_entity);
if (!a_weapon[WCS_WEAPON_SLOT]) {
switch (rg_get_iteminfo(i_entity, ItemInfo_iSlot)) {
case 1: a_weapon[WCS_WEAPON_SLOT] = PISTOL_SLOT;
default: a_weapon[WCS_WEAPON_SLOT] = PRIMARY_WEAPON_SLOT;
}
ArraySetArray(ga_weapon_data, key, a_weapon);
}
if (a_weapon[WCS_WEAPON_ID] != WEAPON_KNIFE)
acs_drop_weapons(id, a_weapon[WCS_WEAPON_SLOT]);
else {
if (CVAR[DYNAMIC_LIMITS])
acs_dec_weapon_limit(id, "weapon_knife");
rg_remove_item(id, "weapon_knife");
}
dllfunc(DLLFunc_Touch, i_entity, id);
i_owner = get_entvar(i_entity, var_owner);
//log_acs("ENT CREATE = %d, id = %d, owner = %d", i_entity, id, i_owner);
if (i_owner == id) {
if (f_maxspeed > rf_get_pcvar_flt(gp_cvar_maxspeed))
rf_set_pcvar_flt(gp_cvar_maxspeed, f_maxspeed);
TrieSetCell(gt_weapon_owner, fmt("%d", i_entity), get_user_userid(id));
if (a_weapon[WCS_DAMAGE] > 0.0 && a_weapon[WCS_DAMAGE] != 1.0) {
switch(a_weapon[WCS_WEAPON_ID]) {
case WEAPON_KNIFE: {
set_member(i_entity, m_Knife_flStabBaseDamage, Float:get_member(i_entity, m_Knife_flStabBaseDamage) * a_weapon[WCS_DAMAGE]);
set_member(i_entity, m_Knife_flSwingBaseDamage, Float:get_member(i_entity, m_Knife_flSwingBaseDamage) * a_weapon[WCS_DAMAGE]);
set_member(i_entity, m_Knife_flSwingBaseDamage_Fast, Float:get_member(i_entity, m_Knife_flSwingBaseDamage_Fast) * a_weapon[WCS_DAMAGE]);
}
case WEAPON_M4A1:
set_member(i_entity, m_M4A1_flBaseDamageSil, Float:get_member(i_entity, m_M4A1_flBaseDamageSil) * a_weapon[WCS_DAMAGE]);
case WEAPON_USP:
set_member(i_entity, m_USP_flBaseDamageSil, Float:get_member(i_entity, m_USP_flBaseDamageSil) * a_weapon[WCS_DAMAGE]);
case WEAPON_FAMAS:
set_member(i_entity, m_Famas_flBaseDamageBurst, Float:get_member(i_entity, m_Famas_flBaseDamageBurst) * a_weapon[WCS_DAMAGE]);
}
set_member(i_entity, m_Weapon_flBaseDamage, Float:get_member(i_entity, m_Weapon_flBaseDamage) * a_weapon[WCS_DAMAGE]);
}
if (a_weapon[WCS_WEAPON_ID] != WEAPON_KNIFE) {
rg_set_user_ammo(id, a_weapon[WCS_WEAPON_ID], a_weapon[WCS_AMMO]);
rg_set_user_bpammo(id, a_weapon[WCS_WEAPON_ID], a_weapon[WCS_BP_AMMO]);
rg_set_iteminfo(i_entity, ItemInfo_iMaxClip, a_weapon[WCS_AMMO]);
rg_set_iteminfo(i_entity, ItemInfo_iMaxAmmo1, a_weapon[WCS_BP_AMMO]);
} else if (a_weapon[WCS_RECOIL] > 0.0 && a_weapon[WCS_RECOIL] != 1.0) {
set_member(i_entity, m_Knife_flStabDistance, Float:get_member(i_entity, m_Knife_flStabDistance) * a_weapon[WCS_RECOIL]);
set_member(i_entity, m_Knife_flSwingDistance, Float:get_member(i_entity, m_Knife_flSwingDistance) * a_weapon[WCS_RECOIL]);
}
acs_pay_off(id, i_cost, a_weapon[WCS_NAME_ITEM], show_notification, is_purchase);
return true;
} else {
log_acs("ENT REMOVE = %d", i_entity);
remove_entity(i_entity);
//acs_remove_entity(i_entity, true);
//engfunc(EngFunc_RemoveEntity, i_entity);
}
}
}
return false;
}

public acs_give_items(const id, const items[]) {
new i_i, s_weapon[ACS_MAX_NAME_ML_LENGTH], s_tmp[ACS_MAX_BUFFER_SIZE];
copy(_SC(s_tmp), items);
do {
strtok(s_tmp, _SC(s_weapon), _SC(s_tmp), ',', 0);
if (!HAS_WEAPON_PREFIX(s_weapon) && contain(_ITEM_PREFIX(s_weapon))) {
if (TrieGetCell(gt_weapon_clcmd, s_weapon, i_i) && 0 <= i_i < ArraySize(ga_weapon_data))
acs_give_weapon(id, i_i, CMD_ADMIN);
} else
acs_give_item(id, s_weapon);
} while (s_tmp[0]);
}

public bool:acs_give_item(const id, const weapon[]) {
static bool:is_relative, i_count, s_params[3 * ACS_MAX_NAME_ML_LENGTH], s_item[ACS_MAX_BUFFER_SIZE];
static a_fade[ACS_WCS_FADE_DATA];
//if (!(!id || is_valid_player(id)))
// return false;
strtok(weapon, _SC(s_item), _SC(s_params), ':', 0);
i_count = str_to_num(s_params);
is_relative = s_params[0] == '+' || s_params[0] == '-';
//acs_client_print(id, ACS_SHOW_DEBUG, "process_task(): id = %d, item_value = %s, count = %d, is_relative = %d", id, _ITEM_VALUE(s_item), i_count, is_relative);
if (!contain(_ITEM_PREFIX(s_item))) {
if (equal(_ITEM_VALUE(s_item), "kevlar")) {
i_count += is_relative ? rg_get_user_armor(id) : 0;
i_count = clamp(i_count, 0, CVAR[MAX_ARMOR]);
if (i_count > 0)
rg_set_user_armor(id, i_count, ARMOR_KEVLAR);
} else if (equal(_ITEM_VALUE(s_item), "vesthelm")) {
i_count += is_relative ? rg_get_user_armor(id) : 0;
i_count = clamp(i_count, 0, CVAR[MAX_ARMOR]);
if (i_count > 0)
rg_set_user_armor(id, i_count, ARMOR_VESTHELM);
} else if (equal(_ITEM_VALUE(s_item), "defuse")) {
rg_give_defusekit(id);
} else if (equal(_ITEM_VALUE(s_item), "ammo")) {
acs_set_max_ammo(id, get_member(id, m_rgpPlayerItems, PRIMARY_WEAPON_SLOT));
acs_set_max_ammo(id, get_member(id, m_rgpPlayerItems, PISTOL_SLOT));
} else if (equal(_ITEM_VALUE(s_item), "hp")) {
i_count += is_relative ? get_user_health(id) : 0;
i_count = clamp(i_count, 0, CVAR[MAX_HP]);
if (i_count > 0)
set_user_health(id, i_count);
} else if (equal(_ITEM_VALUE(s_item), "money")) {
i_count += is_relative ? rg_get_user_money(id) : 0;
i_count = clamp(i_count, 0, CVAR[MAX_MONEY]);
if (i_count >= 0)
rg_add_account(id, i_count, AS_SET);
} else if (equal(_ITEM_VALUE(s_item), "aes") && _AES_EXIST(id)) {
aes_add_player_bonus(id, i_count);
} else if (equal(_ITEM_VALUE(s_item), "exp") && _AES_EXIST(id)) {
aes_add_player_exp(id, float(i_count));
} else if (equal(_ITEM_VALUE(s_item), "damager")) {
ga_damager[id][DMG_ENABLED] = i_count >= 0;
ga_damager[id][DMG_THRESHOLD] = floatclamp(float(i_count), 0.0, 100.0);
} else if (equal(_ITEM_VALUE(s_item), "speed")) {
gi_add_speed[id][SPEED_RELATIVE] = is_relative;
gi_add_speed[id][SPEED_VALUE] = clamp(is_relative ? i_count + gi_add_speed[id][SPEED_VALUE] : i_count, 1);
i_count += floatround(get_user_maxspeed(id));
i_count = clamp(i_count, 0, CVAR[MAX_SPEED]);
//acs_client_print(id, ACS_SHOW_DEBUG, "i_count = %d, user_maxspeed = %f, speed_value = %d, sv_maxspeed = %f", i_count, get_user_maxspeed(id), gi_add_speed[id][SPEED_VALUE], rf_get_pcvar_float(gp_cvar_maxspeed));
//gi_add_speed[id][SPEED_RELATIVE] = is_relative;
if (i_count > rf_get_pcvar_num(gp_cvar_maxspeed))
rf_set_pcvar_num(gp_cvar_maxspeed, i_count);
if (!gb_freeze_time)
set_user_maxspeed(id, float(i_count));
//acs_client_print(id, ACS_SHOW_DEBUG, "ADD_SPEED(): user_maxspeed = %f, sv_maxspeed = %f", get_user_maxspeed(id), get_pcvar_float(gp_cvar_maxspeed));
} else if (equal(_ITEM_VALUE(s_item), "reload")) {
rg_instant_reload_weapons(id);
} else if (equal(_ITEM_VALUE(s_item), "fade")) {
a_fade[FD_ID] = id;
parse(s_params, _SC(a_fade[FD_R]), _SC(a_fade[FD_G]), _SC(a_fade[FD_B]), _SC(a_fade[FD_A]), _SC(a_fade[FD_IN]), _SC(a_fade[FD_OUT]));
acs_fade(a_fade);
} else if (equal(_ITEM_VALUE(s_item), "killfader")) {
ga_killfader[id][KF_ENABLED] = i_count >= 0;
} else if (equal(_ITEM_VALUE(s_item), "evasion")) {
ga_evasion[id][EV_ENABLED] = i_count > 0;
ga_evasion[id][EV_PROBABILITY] = i_count;
} else if (equal(_ITEM_VALUE(s_item), "vampire")) {
ga_vampire[id][VPR_RELATIVE] = is_relative;
ga_vampire[id][VPR_ENABLED] = abs(i_count) > 0;
ga_vampire[id][VPR_MAGNITUDE] = i_count;
} else if (equal(_ITEM_VALUE(s_item), "jump")) {
ga_multi_jump[id][MJ_RELATIVE] = is_relative;
ga_multi_jump[id][MJ_ENABLED] = true;
ga_multi_jump[id][MJ_COUNT] = 0;
acs_init_jump(id, i_count);
} else if (equal(_ITEM_VALUE(s_item), "bhop")) {
set_member(id, m_bAutoBunnyHopping, true);
if (i_count > 0)
set_member(id, m_bMegaBunnyJumping, true);
} else if (equal(_ITEM_VALUE(s_item), "mission")) {
check_map_mission();
} else if (!strfind(_ITEM_VALUE(s_item), "snd_")) {
//acs_client_print(id, ACS_SHOW_DEBUG, "item_snd_%s: %d", _ITEM_SND_VALUE(s_item), i_count);
acs_play_sound(id, i_count, _ITEM_SND_VALUE(s_item));
} else
return false;
} else if (HAS_WEAPON_PREFIX(s_item)) {
//log_acs("WEAPON_ADD: %s, count = %d", s_item, i_count);
i_count = clamp(i_count, 0, CVAR[MAX_AMMO]);
switch (s_item[0]) {
case '+': acs_give_item_ex(id, s_item[1], i_count, GT_APPEND);
case '-': acs_give_item_ex(id, s_item[1], i_count, GT_DROP_AND_REPLACE);
default: acs_give_item_ex(id, s_item, i_count, GT_REPLACE);
}
} else
return false;
return true;
}

public acs_get_weapon_name(const id, const weapon[]) {
static i_key, s_count[ACS_MAX_INT_STR_LENGTH / 2], a_weapon[ACS_WCS], s_weapon_name[ACS_MAX_NAME_ML_LENGTH];
if (!id || is_valid_player(id)) {
strtok(weapon, _SC(s_weapon_name), _SC(s_count), ':', 0);
//acs_client_print(0, ACS_SHOW_DEBUG, "GET_WEAPON_NAME = %s", s_weapon_name);
if (!contain(s_weapon_name, "weapon_")) {
replace_string(_SC(s_weapon_name), "weapon_", "", false);
strtoupper(s_weapon_name);
format(_SC(s_weapon_name), "%L", id, fmt("WP_NAME_%s", s_weapon_name));
//acs_client_print(0, ACS_SHOW_DEBUG, "GET_WEAPON_NAME = %s", s_weapon_name);
} else if ((TrieGetCell(gt_weapon_clcmd, s_weapon_name, i_key) || (is_str_num(weapon) && (i_key = str_to_num(weapon)) >= 0)) && 0 <= i_key < ArraySize(ga_weapon_data)) {
ArrayGetArray(ga_weapon_data, i_key, a_weapon);
copy(_SC(s_weapon_name), a_weapon[WCS_NAME_ITEM]);
}
}
return s_weapon_name;
}

public acs_check_killfader(const id, const type) {
if (ga_killfader[id][KF_ENABLED] && (ga_killfader[id][KF_TYPE] & type))
acs_screen_fade(id, ga_killfader[id][KF_COLOR], ga_killfader[id][KF_FADEOUT], ga_killfader[id][KF_FADEIN], ga_killfader[id][KF_ALPHA]);
}

public acs_check_damager(const victim, const killer, const Float:damage, const damage_type) {
static i_color, v_color[3], i_pos;
static a_color[ACS_WCS_COLORS];
if (is_valid_player(victim) && is_valid_player(killer) && victim != killer
&& (ga_damager[killer][DMG_ENABLED] & (ga_damager[killer][DMG_TYPE] > 0))
&& (!(damage_type & DMG_BLAST) || ga_damager[killer][DMG_TYPE] == 2)
&& damage > ga_damager[killer][DMG_THRESHOLD]
&& rg_is_player_can_takedamage(victim, killer)) {
if ((i_color = ga_damager[killer][DMG_COLOR][0] + ga_damager[killer][DMG_COLOR][1] + ga_damager[killer][DMG_COLOR][2] < 0 ? random_num(0, ArraySize(ga_damager_colors) - 1) : -1) >= 0) {
ArrayGetArray(ga_damager_colors, i_color, a_color);
v_color[0] = str_to_num(a_color[C_R]);
v_color[1] = str_to_num(a_color[C_G]);
v_color[2] = str_to_num(a_color[C_B]);
} else {
v_color[0] = ga_damager[killer][DMG_COLOR][0];
v_color[1] = ga_damager[killer][DMG_COLOR][1];
v_color[2] = ga_damager[killer][DMG_COLOR][2];
}
if ((i_pos = ++ga_damager[killer][DMG_POS]) > sizeof(gv_damager_coords) - 1)
i_pos = ga_damager[killer][DMG_POS] = 0;
set_hudmessage(v_color[0], v_color[1], v_color[2], _DP(i_pos), 0, ga_damager[killer][DMG_FADEIN], ga_damager[killer][DMG_FADEOUT], 0.1, 0.1, -1, ga_damager[killer][DMG_ALPHA]);
ShowSyncHudMsg(killer, gh_hudsync_damager[i_pos % sizeof(gh_hudsync_damager)], "%.0f", damage);
}
}
################
# Hello World! #
################

[REFSAPI] ReHLDS API successfully initialized.
[REFSAPI] ReGAME API successfully initialized.
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid
Aborted

Выдает вот такое, написали что "На сервере нет русскоязычной локали ru-RU.utf8", и хотел бы узнать что для этого нужно, огромное спасибо за ранее
 

Вложения

Сообщения
401
Реакции
113
Помог
2 раз(а)
Покажите вывод команды: locale -a

На Debian/Ubuntu, примерно, так:

sudo locale-gen ru_RU
sudo locale-gen ru_RU.UTF-8
sudo update-locale
 
Сообщения
7
Реакции
0
Офф-топик / Офф-форум
@Refresh,добрый день!
Скажите, с Вами можно как-то связаться?
 
Сообщения
401
Реакции
113
Помог
2 раз(а)
MykolaSimutin, должно работать. Я выложу новую версию через пару дней.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу