diff --git a/cstrike/addons/amxmodx/configs/regg/regg-main.cfg b/cstrike/addons/amxmodx/configs/regg/regg-main.cfg index 1f2c3ca..1487f99 100644 --- a/cstrike/addons/amxmodx/configs/regg/regg-main.cfg +++ b/cstrike/addons/amxmodx/configs/regg/regg-main.cfg @@ -4,9 +4,6 @@ // 2 - FFA regg_mode "0" -// Восстановление гранаты на уровне Hegrenade после броска -regg_nade_refresh "5.0" - // Режим Knife Pro позволяет украсть посредством // убийства с ножа уровень либо очки // Настройка не распространяется на режим командной игры @@ -22,10 +19,11 @@ regg_steal_value "1" regg_team_steal_value "3" // Смена карты, какой плагин использовать +// 0 - ReGG Map Manager, a random map from the maplist (maps.ini or mapcycle.txt) // 1 - Map Manager by Mistrik (v. 3.0.7) // 2 - MapChooser RBS by SKAJIbnEJIb // 3 - Map Manager by Mistrik (v. 2.5.61) -regg_mapchange_type "1" +regg_mapchange_type "0" // Оружие AWP имеет 1 выстрел, перезарядка если не убили regg_awp_oneshot "1" @@ -46,6 +44,12 @@ regg_free_armor 0 // Время разминки в секундах regg_warmup_time "60" +// Тип разминки +// 0 - Всё оружие +// 1 - Только ножи +// +regg_warmup_type "1" + // Удалять объекты на карте, заложники, зона закупки и т.д regg_block_map_conditions "1" diff --git a/cstrike/addons/amxmodx/data/lang/regg.txt b/cstrike/addons/amxmodx/data/lang/regg.txt index 7a9f5f2..36179b3 100644 --- a/cstrike/addons/amxmodx/data/lang/regg.txt +++ b/cstrike/addons/amxmodx/data/lang/regg.txt @@ -34,8 +34,7 @@ REGG_STEAL_LVL = ^3%n ^1украл уровень у ^4%n REGG_STEAL_POINTS = ^3%n ^1украл ^4%d ^1очка у ^4%n REGG_WARMUP_HUD = Разминочный раунд -REGG_WARMUP_START = Начался разминочный раунд! -REGG_WARMUP_END = Разминка завершена!^rПриготовьтесь к бою, игра началась! +REGG_WARMUP_END = Разминка завершена!^nПриготовьтесь к бою, игра началась! REGG_VOTE_MENU = Голосование за выбор режима игры: REGG_MODE_SINGLE = Одиночный diff --git a/cstrike/addons/amxmodx/scripting/include/regg.inc b/cstrike/addons/amxmodx/scripting/include/regg.inc index c553c64..80d6726 100644 --- a/cstrike/addons/amxmodx/scripting/include/regg.inc +++ b/cstrike/addons/amxmodx/scripting/include/regg.inc @@ -21,7 +21,7 @@ #define REGG_MAJOR_VERSION 0 #define REGG_MINOR_VERSION 4 -#define REGG_MAINTENANCE_VERSION 36 +#define REGG_MAINTENANCE_VERSION 40 #define REGG_VERSION str_to_num(fmt("%d%d%d", REGG_MAJOR_VERSION, REGG_MINOR_VERSION, REGG_MAINTENANCE_VERSION)) #define REGG_VERSION_STR fmt("%d.%d.%d-alpha", REGG_MAJOR_VERSION, REGG_MINOR_VERSION, REGG_MAINTENANCE_VERSION) diff --git a/cstrike/addons/amxmodx/scripting/regg/config.inl b/cstrike/addons/amxmodx/scripting/regg/config.inl index 18284b2..cf913c3 100644 --- a/cstrike/addons/amxmodx/scripting/regg/config.inl +++ b/cstrike/addons/amxmodx/scripting/regg/config.inl @@ -23,6 +23,7 @@ enum config_section_s { }; enum _:game_cvars_s { + Float:GCRoundTime, GCRoundInfinite[32], Float:GCForcerespawn, GCRefillBpammoWeapons, @@ -106,6 +107,10 @@ registerCvars() { changeGameCvars() { new pcvar; + pcvar = get_cvar_pointer("mp_roundtime"); + GameCvars[GCRoundTime] = get_pcvar_float(pcvar); + set_pcvar_float(pcvar, 0.0); + pcvar = get_cvar_pointer("mp_round_infinite"); get_pcvar_string(pcvar, GameCvars[GCRoundInfinite], charsmax(GameCvars[GCRoundInfinite])); set_pcvar_num(pcvar, 1); diff --git a/cstrike/addons/amxmodx/scripting/regg/functions.inl b/cstrike/addons/amxmodx/scripting/regg/functions.inl index 936d53a..28ce17f 100644 --- a/cstrike/addons/amxmodx/scripting/regg/functions.inl +++ b/cstrike/addons/amxmodx/scripting/regg/functions.inl @@ -22,15 +22,17 @@ bool:start(const ReGG_Mode:mode) { Mode = mode; set_member_game(m_bCompleteReset, true); + set_member_game(m_bGameStarted, true); rg_round_end( .tmDelay = 3.0, .st = WINSTATUS_DRAW, .event = ROUND_END_DRAW, - .message = "GunGame Mod started!", - .sentence = "", + .message = "", + .sentence = "", .trigger = true ); + DebugMode && log_amx("GunGame Mod started!"); return true; } @@ -46,7 +48,17 @@ bool:finish(const killer, const victim) { Mode = ReGG_ModeNone; set_member_game(m_bCompleteReset, true); - rg_restart_round(); + + rg_round_end( + .tmDelay = 3.0, + .st = WINSTATUS_DRAW, + .event = ROUND_END_DRAW, + .message = "Game over!", + .sentence = "", + .trigger = true + ); + DebugMode && log_amx("GunGame Mod finished!"); + return true; } diff --git a/cstrike/addons/amxmodx/scripting/regg_core.sma b/cstrike/addons/amxmodx/scripting/regg_core.sma index 898668c..3563fe1 100644 --- a/cstrike/addons/amxmodx/scripting/regg_core.sma +++ b/cstrike/addons/amxmodx/scripting/regg_core.sma @@ -35,6 +35,8 @@ new Players[MAX_PLAYERS + 1][player_s]; new Teams[2][team_s]; new WeaponIdType:GrenadeWeapons[MAX_GRENADE_WEAPONS], GrenadeWeaponsNum; +new bool:DebugMode; + #include "regg/config.inl" #include "regg/forwards.inl" #include "regg/hooks.inl" @@ -57,6 +59,9 @@ public plugin_init() { registerForwards(); loadCfg(); loadIni(); + + DebugMode = bool:(plugin_flags() & AMX_FLAG_DEBUG); + DebugMode && log_amx("Debug mode is enable!"); } public plugin_cfg() { diff --git a/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma b/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma index 3c33f67..914d355 100644 --- a/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma +++ b/cstrike/addons/amxmodx/scripting/regg_mapmanager.sma @@ -1,7 +1,9 @@ #include +#include #include -new VoteType; +new VoteType, gMapNums; +new Array:gMapName; public plugin_init() { register_plugin("[ReGG] Map Manager", REGG_VERSION_STR, "Jumper & d3m37r4"); @@ -9,8 +11,12 @@ public plugin_init() { bind_pcvar_num(create_cvar( "regg_mapchange_type", "1", .has_min = true, - .min_val = 1.0 + .min_val = 0.0 ), VoteType); + + gMapName = ArrayCreate(MAX_NAME_LENGTH); + + loadMapCfg(); } public ReGG_FinishPost(const killer, const victim) { @@ -19,6 +25,13 @@ public ReGG_FinishPost(const killer, const victim) { public MapChange() { switch(VoteType){ + case 0: { + new mapname[MAX_NAME_LENGTH]; + ArrayGetString(gMapName, random(gMapNums), mapname, charsmax(mapname)); + message_begin(MSG_ALL, SVC_INTERMISSION); + message_end(); + engine_changelevel(mapname); + } case 1: { server_cmd("mapm_start_vote"); } @@ -30,3 +43,62 @@ public MapChange() { } } } + +loadMapCfg() { + new maps_file[PLATFORM_MAX_PATH]; + get_configsdir(maps_file, charsmax(maps_file)); + format(maps_file, charsmax(maps_file), "%s/maps.ini", maps_file); + + if(!file_exists(maps_file)) { + get_cvar_string("mapcyclefile", maps_file, charsmax(maps_file)); + } + + if(!file_exists(maps_file)) { + format(maps_file, charsmax(maps_file), "mapcycle.txt") + } + + loadMapsFile(maps_file); +} + +loadMapsFile(file[]) { + new iFile = fopen(file, "rt"); + if(!iFile) { + set_fail_state("File ^"%s^" is not found", file); + } + + new szBuffer[PLATFORM_MAX_PATH], szMaps[MAX_NAME_LENGTH]; + while(!feof(iFile)) { + fgets(iFile, szBuffer, charsmax(szBuffer)); + parse(szBuffer, szMaps, charsmax(szMaps)); + + if(!szBuffer[0] || szBuffer[0] == ';' || !isValidMap(szMaps)) { + continue; + } + + ArrayPushString(gMapName, szMaps); + gMapNums++; + } + + fclose(iFile); +} + +stock bool:isValidMap(mapname[]) { + if (is_map_valid(mapname)){ + return true; + } + + new len = strlen(mapname) - 4; + if (len < 0) { + return false; + } + + if (equali(mapname[len], ".bsp")){ + mapname[len] = '^0'; + + if (is_map_valid(mapname)) { + return true; + } + } + + return false; +} diff --git a/cstrike/addons/amxmodx/scripting/regg_warmup.sma b/cstrike/addons/amxmodx/scripting/regg_warmup.sma index 05d1c8e..ee20d72 100644 --- a/cstrike/addons/amxmodx/scripting/regg_warmup.sma +++ b/cstrike/addons/amxmodx/scripting/regg_warmup.sma @@ -10,14 +10,30 @@ enum _:game_cvars_s { Float:GCForceRespawn, GCTimelimit, GCFraglimit, + GCGivePlayerC4, GCWeaponsAllowMapPlaced, + GCTDefaultGrenades[32], + GCTDefaultWeaponsSecondary[32], + GCTDefaultWeaponsPrimary[32], + GCCTDefaultGrenades[32], + GCTGivePlayerKnife, + GCCTGivePlayerKnife, + GCCTDefaultWeaponsSecondary[32], + GCCTDefaultWeaponsPrimary[32], + GCRefillBpammoWeapons, + GCStartMoney, + GCBuyAnywhere, + Float:GCBuyTime, + GCItemStaytime, + GCRoundOver, }; new GameCvars[game_cvars_s]; enum _:hook_s { - HookChain:HookHasRestrictItem, + HookChain:HookCleanUpMap, HookChain:HookPlayerSpawn, HookChain:HookPlayerKilled, + HookChain:HookRoundEnd, }; new HookChain:Hooks[hook_s]; @@ -46,6 +62,21 @@ enum state_s { StateDisable, }; +enum warmuptype_s { + WarmupTypeAllWeapons, + WarmupTypeOnlyKnife, +}; +new warmuptype_s:WarmupType; + +enum costtype_s { + CostTypeWeapon, + CostTypeClip, +}; +new WeaponIdType:DefaultWeaponCost[WeaponIdType][costtype_s]; + +new bool:MapHasBombTarget, bool:MapHasBombZone, bool:MapHasRescueZone, bool:MapHasBuyZone, bool:MapHasEscapeZone, bool:MapHasVIPSafetyZone; +new bool:CTCantBuy, bool:TCantBuy; + new ReGG_Mode:Mode = ReGG_ModeNone; new WarmupTime; new SyncHud; @@ -57,11 +88,17 @@ public plugin_init() { registerHooks(); toggleHooks(StateDisable); + getDefaultWeaponCost(); bind_pcvar_num(create_cvar( "regg_warmup_time", "60", .has_min = true, .min_val = 0.0 ), WarmupTime); + bind_pcvar_num(create_cvar( + "regg_warmup_type", "1", + .has_min = true, .min_val = 0.0, + .has_max = true, .max_val = 1.0 + ), WarmupType); SyncHud = CreateHudSyncObj(); DebugMode = bool:(plugin_flags() & AMX_FLAG_DEBUG); @@ -75,6 +112,7 @@ public plugin_pause() { restoreGameCvars(); toggleHooks(StateDisable); + (WarmupType == WarmupTypeAllWeapons) && makeAllWeaponsFree(.make_free = true); Status = StatusNone; } @@ -88,19 +126,17 @@ public ReGG_StartPre(const ReGG_Mode:mode) { return PLUGIN_HANDLED; } + // Block the launch of mod and call start of warmup Mode = mode; startWarmUp(); return PLUGIN_HANDLED; } -public CBasePlayer_HasRestrictItem_Pre(const id, const ItemID:item, const ItemRestType:type) { - if(item == ITEM_KNIFE) { - return HC_CONTINUE; - } - - SetHookChainReturn(ATYPE_BOOL, true); - return HC_SUPERCEDE; +public CSGameRules_CleanUpMap_Post() { + changeMembersGameData(); + removeHostageEntities(); + removeTargetNameEntities(); } public CBasePlayer_Spawn_Post(const id) { @@ -125,6 +161,17 @@ public CBasePlayer_Killed_Post(const id) { return HC_CONTINUE; } +public RoundEnd_Pre(WinStatus:status, ScenarioEventEndRound:event, Float:tmDelay) { + if(Status == StatusStarted && status == WINSTATUS_DRAW && event == ROUND_GAME_COMMENCE) { + return HC_CONTINUE; + } + + SetHookChainArg(1, ATYPE_INTEGER, WINSTATUS_NONE); + SetHookChainArg(2, ATYPE_INTEGER, ROUND_NONE); + stopWarmUp(); + return HC_CONTINUE; +} + public startWarmUp() { if(Status == StatusStarted) { return; @@ -134,13 +181,18 @@ public startWarmUp() { changeGameCvars(); toggleHooks(StateEnable); + (WarmupType == WarmupTypeAllWeapons) && makeAllWeaponsFree(.make_free = true); set_member_game(m_bCompleteReset, false); - rg_restart_round(); + rg_round_end( + .tmDelay = 0.0, + .st = WINSTATUS_DRAW, + .event = ROUND_GAME_COMMENCE, + .message = "", + .sentence = "", + .trigger = true + ); - set_task(float(WarmupTime), "stopWarmUp"); - - client_print(0, print_center, "%L", LANG_PLAYER, "REGG_WARMUP_START"); DebugMode && log_amx("Warmup mode is started!"); } @@ -153,6 +205,10 @@ public stopWarmUp() { restoreGameCvars(); toggleHooks(StateDisable); + (WarmupType == WarmupTypeAllWeapons) && makeAllWeaponsFree(.make_free = false); + restoreMembersGameData(); + restoreHostageEntities(); + restoreTargetNameEntities(); for(new player = 1; player <= MaxClients; player++) { if(!is_user_alive(player)) { @@ -163,25 +219,24 @@ public stopWarmUp() { ClearSyncHud(player, SyncHud); } - ReGG_Start(Mode); - client_print(0, print_center, "%L", LANG_PLAYER, "REGG_WARMUP_END"); + + ReGG_Start(Mode); DebugMode && log_amx("Warmup mode is finished!"); } registerHooks() { - Hooks[HookHasRestrictItem] = RegisterHookChain(RG_CBasePlayer_HasRestrictItem, "CBasePlayer_HasRestrictItem_Pre", false); + Hooks[HookCleanUpMap] = RegisterHookChain(RG_CSGameRules_CleanUpMap, "CSGameRules_CleanUpMap_Post", true); Hooks[HookPlayerSpawn] = RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn_Post", true); Hooks[HookPlayerKilled] = RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed_Post", true); + Hooks[HookRoundEnd] = RegisterHookChain(RG_RoundEnd, "RoundEnd_Pre", false); } toggleHooks(state_s:_state) { for(new i; i < hook_s; i++) { - if(!Hooks[i]) { - continue; + if(Hooks[i]) { + _state == StateEnable ? EnableHookChain(Hooks[i]) : DisableHookChain(Hooks[i]); } - - _state == StateEnable ? EnableHookChain(Hooks[i]) : DisableHookChain(Hooks[i]); } } @@ -194,7 +249,7 @@ changeGameCvars() { pcvar = get_cvar_pointer("mp_round_infinite"); get_pcvar_string(pcvar, GameCvars[GCRoundInfinite], charsmax(GameCvars[GCRoundInfinite])); - set_pcvar_string(pcvar, "bcdefg"); + set_pcvar_string(pcvar, "bcdefghjk"); pcvar = get_cvar_pointer("mp_forcerespawn"); GameCvars[GCForceRespawn] = get_pcvar_float(pcvar); @@ -208,9 +263,73 @@ changeGameCvars() { GameCvars[GCFraglimit] = get_pcvar_num(pcvar); set_pcvar_num(pcvar, 0); + pcvar = get_cvar_pointer("mp_give_player_c4"); + GameCvars[GCGivePlayerC4] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 0); + pcvar = get_cvar_pointer("mp_weapons_allow_map_placed"); GameCvars[GCWeaponsAllowMapPlaced] = get_pcvar_num(pcvar); set_pcvar_num(pcvar, 0); + + if(WarmupType == WarmupTypeOnlyKnife) { + pcvar = get_cvar_pointer("mp_t_default_grenades"); + get_pcvar_string(pcvar, GameCvars[GCTDefaultGrenades], charsmax(GameCvars[GCTDefaultGrenades])); + set_pcvar_string(pcvar, ""); + + pcvar = get_cvar_pointer("mp_t_default_weapons_secondary"); + get_pcvar_string(pcvar, GameCvars[GCTDefaultWeaponsSecondary], charsmax(GameCvars[GCTDefaultWeaponsSecondary])); + set_pcvar_string(pcvar, ""); + + pcvar = get_cvar_pointer("mp_t_default_weapons_primary"); + get_pcvar_string(pcvar, GameCvars[GCTDefaultWeaponsPrimary], charsmax(GameCvars[GCTDefaultWeaponsPrimary])); + set_pcvar_string(pcvar, ""); + + pcvar = get_cvar_pointer("mp_ct_default_grenades"); + get_pcvar_string(pcvar, GameCvars[GCCTDefaultGrenades], charsmax(GameCvars[GCCTDefaultGrenades])); + set_pcvar_string(pcvar, ""); + + pcvar = get_cvar_pointer("mp_ct_default_weapons_secondary"); + get_pcvar_string(pcvar, GameCvars[GCCTDefaultWeaponsSecondary], charsmax(GameCvars[GCCTDefaultWeaponsSecondary])); + set_pcvar_string(pcvar, ""); + + pcvar = get_cvar_pointer("mp_ct_default_weapons_primary"); + get_pcvar_string(pcvar, GameCvars[GCCTDefaultWeaponsPrimary], charsmax(GameCvars[GCCTDefaultWeaponsPrimary])); + set_pcvar_string(pcvar, ""); + } + + pcvar = get_cvar_pointer("mp_t_give_player_knife"); + GameCvars[GCTGivePlayerKnife] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 1); + + pcvar = get_cvar_pointer("mp_ct_give_player_knife"); + GameCvars[GCCTGivePlayerKnife] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 1); + + if(WarmupType == WarmupTypeAllWeapons) { + pcvar = get_cvar_pointer("mp_refill_bpammo_weapons"); + GameCvars[GCRefillBpammoWeapons] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 3); + + pcvar = get_cvar_pointer("mp_startmoney"); + GameCvars[GCStartMoney] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 999999); // We set maximum possible value, it will still be trimmed taking into account 'mp_maxmoney'. + + pcvar = get_cvar_pointer("mp_buy_anywhere"); + GameCvars[GCBuyAnywhere] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 1); + } + + pcvar = get_cvar_pointer("mp_buytime"); + GameCvars[GCBuyTime] = get_pcvar_float(pcvar); + set_pcvar_float(pcvar, WarmupType == WarmupTypeOnlyKnife ? 0.0 : -1.0); + + pcvar = get_cvar_pointer("mp_item_staytime"); + GameCvars[GCItemStaytime] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 0); + + pcvar = get_cvar_pointer("mp_roundover"); + GameCvars[GCRoundOver] = get_pcvar_num(pcvar); + set_pcvar_num(pcvar, 1); } restoreGameCvars() { @@ -231,6 +350,169 @@ restoreGameCvars() { pcvar = get_cvar_pointer("mp_fraglimit"); set_pcvar_num(pcvar, GameCvars[GCFraglimit]); + pcvar = get_cvar_pointer("mp_give_player_c4"); + set_pcvar_num(pcvar, GameCvars[GCGivePlayerC4]); + pcvar = get_cvar_pointer("mp_weapons_allow_map_placed"); set_pcvar_num(pcvar, GameCvars[GCWeaponsAllowMapPlaced]); + + if(WarmupType == WarmupTypeOnlyKnife) { + pcvar = get_cvar_pointer("mp_t_default_grenades"); + set_pcvar_string(pcvar, GameCvars[GCTDefaultGrenades]); + + pcvar = get_cvar_pointer("mp_t_default_weapons_secondary"); + set_pcvar_string(pcvar, GameCvars[GCTDefaultWeaponsSecondary]); + + pcvar = get_cvar_pointer("mp_t_default_weapons_primary"); + set_pcvar_string(pcvar, GameCvars[GCTDefaultWeaponsPrimary]); + + pcvar = get_cvar_pointer("mp_ct_default_grenades"); + set_pcvar_string(pcvar, GameCvars[GCCTDefaultGrenades]); + + pcvar = get_cvar_pointer("mp_ct_default_weapons_secondary"); + set_pcvar_string(pcvar, GameCvars[GCCTDefaultWeaponsSecondary]); + + pcvar = get_cvar_pointer("mp_ct_default_weapons_primary"); + set_pcvar_string(pcvar, GameCvars[GCCTDefaultWeaponsPrimary]); + } + + pcvar = get_cvar_pointer("mp_t_give_player_knife"); + set_pcvar_num(pcvar, GameCvars[GCTGivePlayerKnife]); + + pcvar = get_cvar_pointer("mp_ct_give_player_knife"); + set_pcvar_num(pcvar, GameCvars[GCCTGivePlayerKnife]); + + if(WarmupType == WarmupTypeAllWeapons) { + pcvar = get_cvar_pointer("mp_refill_bpammo_weapons"); + set_pcvar_num(pcvar, GameCvars[GCRefillBpammoWeapons]); + + pcvar = get_cvar_pointer("mp_startmoney"); + set_pcvar_num(pcvar, GameCvars[GCStartMoney]); + + pcvar = get_cvar_pointer("mp_buy_anywhere"); + set_pcvar_num(pcvar, GameCvars[GCBuyAnywhere]); + } + + pcvar = get_cvar_pointer("mp_buytime"); + set_pcvar_float(pcvar, GameCvars[GCBuyTime]); + + pcvar = get_cvar_pointer("mp_item_staytime"); + set_pcvar_num(pcvar, GameCvars[GCItemStaytime]); + + pcvar = get_cvar_pointer("mp_roundover"); + set_pcvar_num(pcvar, GameCvars[GCRoundOver]); +} + +getDefaultWeaponCost() { + for(new WeaponIdType:weapon = WEAPON_P228; weapon <= WEAPON_P90; weapon++) { + if(weapon != WEAPON_C4 && weapon != WEAPON_KNIFE) { + DefaultWeaponCost[weapon][CostTypeWeapon] = rg_get_weapon_info(weapon, WI_COST); + DefaultWeaponCost[weapon][CostTypeClip] = rg_get_weapon_info(weapon, WI_CLIP_COST); + } + } } + +// Алексеич (https://dev-cs.ru/members/3/) would have thought that we were talking about French fries *kappa* +makeAllWeaponsFree(bool:make_free = true) { + for(new WeaponIdType:weapon = WEAPON_P228; weapon <= WEAPON_P90; weapon++) { + if(weapon != WEAPON_C4 && weapon != WEAPON_KNIFE) { + rg_set_weapon_info(weapon, WI_COST, make_free ? 0 : DefaultWeaponCost[weapon][CostTypeWeapon]); + rg_set_weapon_info(weapon, WI_CLIP_COST, make_free ? 0 : DefaultWeaponCost[weapon][CostTypeClip]); + } + } +} + +getMembersGameData() { + MapHasBombTarget = get_member_game(m_bMapHasBombTarget); + MapHasBombZone = get_member_game(m_bMapHasBombZone); + MapHasRescueZone = get_member_game(m_bMapHasRescueZone); + MapHasBuyZone = get_member_game(m_bMapHasBuyZone); + MapHasEscapeZone = get_member_game(m_bMapHasEscapeZone); + MapHasVIPSafetyZone = get_member_game(m_bMapHasVIPSafetyZone); + CTCantBuy = get_member_game(m_bCTCantBuy); + TCantBuy = get_member_game(m_bTCantBuy); +} + +changeMembersGameData() { + getMembersGameData(); // Remembered the data before changing + + set_member_game(m_bMapHasBombTarget, false); + set_member_game(m_bMapHasBombZone, false); + set_member_game(m_bMapHasRescueZone, false); + set_member_game(m_bMapHasBuyZone, WarmupType == WarmupTypeAllWeapons ? true : false); + set_member_game(m_bMapHasEscapeZone, false); + set_member_game(m_bMapHasVIPSafetyZone, false); + set_member_game(m_bCTCantBuy, WarmupType != WarmupTypeAllWeapons ? true : false); + set_member_game(m_bTCantBuy, WarmupType != WarmupTypeAllWeapons ? true : false); +} + +restoreMembersGameData() { + set_member_game(m_bMapHasBombTarget, MapHasBombTarget); + set_member_game(m_bMapHasBombZone, MapHasBombZone); + set_member_game(m_bMapHasRescueZone, MapHasRescueZone); + set_member_game(m_bMapHasBuyZone, MapHasBuyZone); + set_member_game(m_bMapHasEscapeZone, MapHasEscapeZone); + set_member_game(m_bMapHasVIPSafetyZone, MapHasVIPSafetyZone); + set_member_game(m_bCTCantBuy, CTCantBuy); + set_member_game(m_bTCantBuy, TCantBuy); +} + +removeHostageEntities() { + new ent; + while((ent = rg_find_ent_by_class(ent, "hostage_entity"))) { + removeEntity(ent); + } + while((ent = rg_find_ent_by_class(ent, "monster_scientist"))) { + removeEntity(ent); + } +} + +restoreHostageEntities() { + new ent; + while((ent = rg_find_ent_by_class(ent, "hostage_entity"))) { + restoreEntity(ent); + } + while((ent = rg_find_ent_by_class(ent, "monster_scientist"))) { + restoreEntity(ent); + } +} + +removeTargetNameEntities() { + new ent; + while((ent = rg_find_ent_by_class(ent, "player_weaponstrip"))) { + set_entvar(ent, var_targetname, "stripper_dummy"); + } + while((ent = rg_find_ent_by_class(ent, "game_player_equip"))) { + set_entvar(ent, var_targetname,"equipment_dummy"); + } +} + +restoreTargetNameEntities() { + new ent; + while((ent = rg_find_ent_by_class(ent, "player_weaponstrip"))) { + set_entvar(ent, var_targetname, "stripper"); + } + while((ent = rg_find_ent_by_class(ent, "game_player_equip"))) { + set_entvar(ent, var_targetname,"equipment"); + } +} + +removeEntity(const entity) { + set_entvar(entity, var_health, 0.0); + set_entvar(entity, var_takedamage, DAMAGE_NO); + set_entvar(entity, var_movetype, MOVETYPE_NONE); + set_entvar(entity, var_deadflag, DEAD_DEAD); + set_entvar(entity, var_effects, get_entvar(entity, var_effects) | EF_NODRAW); + set_entvar(entity, var_solid, SOLID_NOT); + set_entvar(entity, var_nextthink, -1.0); +} + +restoreEntity(const entity) { + set_entvar(entity, var_health, Float:get_entvar(entity, var_max_health)); + set_entvar(entity, var_takedamage, DAMAGE_YES); + set_entvar(entity, var_movetype, MOVETYPE_STEP); + set_entvar(entity, var_deadflag, DEAD_NO); + set_entvar(entity, var_effects, get_entvar(entity, var_effects) & ~EF_NODRAW); + set_entvar(entity, var_solid, SOLID_SLIDEBOX); + set_entvar(entity, var_nextthink, get_gametime() + 0.01); +} \ No newline at end of file