Skip to content

Commit

Permalink
v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Feb 2, 2024
1 parent 3268cee commit 5f3a5c1
Show file tree
Hide file tree
Showing 10 changed files with 240 additions and 32 deletions.
19 changes: 19 additions & 0 deletions data/lang/match_additons.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,24 @@ MENU_TRNING_TLPRT = Teleport
MENU_TRNING_NOCLIP = No Clip
MENU_TRNING_RESPAWN = Respawn
MENU_TRNING_DAMAGE = Damage
MENU_TRNING_ANGL_ON = Save angles \yOn
MENU_TRNING_ANGL_OFF = Save angles \dOff
MENU_TRNING_INVIS_ON = Invis players \yOn
MENU_TRNING_INVIS_OFF = Invis players \dOff
MENU_TRNING_WEAPONS = Get weapons

TRNING_NOT_ALIVE = %s You must be alive to use this command!
TRNING_CPNT_SAVE = %s Checkpoint saved!
TRNING_TLPRT_NOT = %s You haven't got any checkpoints!
TRNING_STUCK_NOT = %s You must have another checkpoint to use stuck!
TRNING_SHOW_ON = %s Damage show ^3enabled^1!
TRNING_SHOW_OFF = %s Damage show ^3disabled^1!
TRNING_ANGLES_ON = %s Save angles ^3enabled^1!
TRNING_ANGLES_OFF = %s Save angles ^3disabled^1!
TRNING_CLIP_ON = %s No Clip ^3enabled^1!
TRNING_CLIP_OFF = %s No Clip ^3disabled^1!
TRNING_INVIS_ON = %s Invis players ^3enabled^1!
TRNING_INVIS_OFF = %s Invis players ^3disabled^1!
TRNING_DMG = %s You have taken ^3%i^1 damage.

HNS_OWNAGE_MIX = %n owned %n's head! [#%d]
Expand Down Expand Up @@ -107,15 +116,25 @@ MENU_TRNING_TLPRT = Телепорт
MENU_TRNING_NOCLIP = Ноклип
MENU_TRNING_RESPAWN = Возродиться
MENU_TRNING_DAMAGE = Показать дамаг
MENU_TRNING_ANGL_ON = Сохранять прицел \yOn
MENU_TRNING_ANGL_OFF = Сохранять прицел \dOff
MENU_TRNING_INVIS_ON = Невидимные игроки \yOn
MENU_TRNING_INVIS_OFF = Невидимные игроки \dOff
MENU_TRNING_WEAPONS = Получить оружие


TRNING_NOT_ALIVE = %s Вы должны быть живы, чтобы использовать эту команду!
TRNING_CPNT_SAVE = %s Чекпоинт сохранена!
TRNING_TLPRT_NOT = %s У вас нет чекпоинтов!
TRNING_STUCK_NOT = %s У вас должен быть другой чекпоинт, чтобы использовать stuck!
TRNING_SHOW_ON = %s Показать урон: ^3влючено^1!
TRNING_SHOW_OFF = %s Показать урон: ^3выключено^1!
TRNING_ANGLES_ON = %s Сохранять прицел ^3влючено^1!
TRNING_ANGLES_OFF = %s Сохранять прицел ^3выключено^1!
TRNING_CLIP_ON = %s Ноклип ^3включен^1!
TRNING_CLIP_OFF = %s Ноклип ^3выключен^1!
TRNING_INVIS_ON = %s Невидимные игроки ^3влючено^1!
TRNING_INVIS_OFF = %s Невидимные игроки ^3выключено^1!
TRNING_DMG = %s Вы получили ^3%i^1 урона.

HNS_OWNAGE_MIX = %n запрыгнул на голову %n! [#%d]
Expand Down
2 changes: 2 additions & 0 deletions data/lang/mixsystem.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ NOT_CAPTAIN = Only available on the knife map.

START_MIX = ^3%n^1 has started ^3mix^1.
START_KNIFE = Started ^3knife^1 round!
START_KNIFE_1 = ^3%n^1 has started ^3knife^1 round!

STOP_MIX = ^3%n^1 stopped ^3mix^1.
STOP_KNIFE = ^3%n^1 stopped ^3knife^1 round^1.
Expand Down Expand Up @@ -235,6 +236,7 @@ NOT_CAPTAIN = Доступно только на ножевой карте.

START_MIX = ^3%n^1 запустил ^3микс^1!
START_KNIFE = Запущен ^3ножевой^1 раунд!
START_KNIFE_1 = ^3%n^1 запустил ^3ножевой^1 раунд!

STOP_MIX = ^3%n^1 остановил ^3микс^1.
STOP_KNIFE = ^3%n^1 остановил ^3ножевой раунд^1.
Expand Down
2 changes: 1 addition & 1 deletion scripting/HnsMatchSystem.sma
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public plugin_precache() {
}

public plugin_init() {
g_PluginId = register_plugin("Hide'n'Seek Match System", "2.0.0", "OpenHNS"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor, Juice
g_PluginId = register_plugin("Hide'n'Seek Match System", "2.0.1", "OpenHNS"); // Спасибо: Cultura, Garey, Medusa, Ruffman, Conor, Juice

rh_get_mapname(g_szMapName, charsmax(g_szMapName));

Expand Down
178 changes: 177 additions & 1 deletion scripting/HnsMatchTraining.sma
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <amxmodx>
#include <reapi>
#include <fakemeta>
#include <hns_matchsystem>

new g_szPrefix[24];
Expand All @@ -11,6 +12,8 @@ new Float:g_fCheckpointAngles[MAX_PLAYERS + 1][3];
new Float:g_fCheckpoints[MAX_PLAYERS + 1][2][3];
new bool:g_fCheckpointAlternate[MAX_PLAYERS + 1];

new bool:g_bInvisPlayers[MAX_PLAYERS + 1];

new g_hResetBugForward;

public plugin_init() {
Expand All @@ -24,9 +27,20 @@ public plugin_init() {
RegisterSayCmd("stuck", "st", "CmdStuck");
RegisterSayCmd("respawn", "rp", "CmdRespawn");
RegisterSayCmd("noclip", "clip", "CmdClipMode");
RegisterSayCmd("showdamage", "showdmg", "CmdShowDamage");
RegisterSayCmd("showdamage", "showdmg", "CmdShowDamage");
RegisterSayCmd("angles", "ang", "CmdSaveAngles");
RegisterSayCmd("invis", "inv", "cmdInvis");

RegisterSayCmd("weapons", "weap", "cmdWeapons");
RegisterSayCmd("scout", "sc", "cmdScout");
RegisterSayCmd("usp", "pistol", "cmdUsp");
RegisterSayCmd("awp", "sniper", "cmdAWP");
RegisterSayCmd("m4a1", "m4", "cmdM4A1");

RegisterHookChain(RG_CSGameRules_FlPlayerFallDamage, "rgFlPlayerFallDamage", true);
RegisterHookChain(RG_CBasePlayer_Spawn, "rgPlayerSpawn", false);

register_forward(FM_AddToFullPack, "fmAddToFullPack", 1);

g_hResetBugForward = CreateMultiForward("fwResetBug", ET_IGNORE, FP_CELL);

Expand All @@ -35,6 +49,8 @@ public plugin_init() {

public client_putinserver(id) {
g_bDamage[id] = true;
g_bSaveAngles[id] = true;
g_bInvisPlayers[id] = false;
}

public plugin_cfg() {
Expand Down Expand Up @@ -173,6 +189,92 @@ public CmdShowDamage(id) {
return PLUGIN_HANDLED;
}

public CmdSaveAngles(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

g_bSaveAngles[id] = !g_bSaveAngles[id];

if (g_bSaveAngles[id]) {
client_print_color(id, print_team_blue, "%L", id, "TRNING_ANGLES_ON", g_szPrefix);
} else {
client_print_color(id, print_team_blue, "%L", id, "TRNING_ANGLES_OFF", g_szPrefix);
}

return PLUGIN_HANDLED;
}

public cmdInvis(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

g_bInvisPlayers[id] = !g_bInvisPlayers[id];

if (g_bInvisPlayers[id]) {
client_print_color(id, print_team_blue, "%L", id, "TRNING_INVIS_ON", g_szPrefix);
} else {
client_print_color(id, print_team_blue, "%L", id, "TRNING_INVIS_OFF", g_szPrefix);
}

return PLUGIN_HANDLED;
}

public cmdWeapons(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

give_user_item(id, "weapon_awp", 10);
give_user_item(id, "weapon_m249", 10);
give_user_item(id, "weapon_m4a1", 10);
give_user_item(id, "weapon_sg552", 10);
give_user_item(id, "weapon_famas", 10);
give_user_item(id, "weapon_p90", 10);
give_user_item(id, "weapon_usp", 10, GT_REPLACE);
give_user_item(id, "weapon_scout", 10);

return PLUGIN_HANDLED;
}

public cmdScout(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

give_user_item(id, "weapon_scout", 10, GT_REPLACE);
return PLUGIN_HANDLED;
}

public cmdUsp(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

give_user_item(id, "weapon_usp", 10, GT_REPLACE);
return PLUGIN_HANDLED;
}

public cmdAWP(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

give_user_item(id, "weapon_awp", 2, GT_REPLACE);
return PLUGIN_HANDLED;
}

public cmdM4A1(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return PLUGIN_HANDLED
}

give_user_item(id, "weapon_m4a1", 10, GT_REPLACE);
return PLUGIN_HANDLED;
}


public hns_training_menu(id) {
if ((hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) || !is_user_connected(id))
return PLUGIN_HANDLED;
Expand All @@ -197,6 +299,26 @@ public hns_training_menu(id) {
formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_DAMAGE");
menu_additem(hMenu, szMsg, "5");

if (g_bSaveAngles[id]) {
formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_ANGL_ON");
} else {
formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_ANGL_OFF");
}

menu_additem(hMenu, szMsg, "6");

if (g_bInvisPlayers[id]) {
formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_INVIS_ON");
} else {
formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_INVIS_OFF");
}

menu_additem(hMenu, szMsg, "7");

formatex(szMsg, charsmax(szMsg), "%L", LANG_PLAYER, "MENU_TRNING_WEAPONS");
menu_additem(hMenu, szMsg, "8");


menu_display(id, hMenu, 0);

return PLUGIN_HANDLED;
Expand Down Expand Up @@ -227,6 +349,15 @@ public hns_training_menu_code(id, hMenu, item) {
case 5: {
CmdShowDamage(id);
}
case 6: {
CmdSaveAngles(id);
}
case 7: {
cmdInvis(id);
}
case 8: {
cmdWeapons(id);
}
}

menu_destroy(hMenu);
Expand All @@ -235,6 +366,16 @@ public hns_training_menu_code(id, hMenu, item) {
return PLUGIN_HANDLED;
}

public rgPlayerSpawn(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return HC_CONTINUE;
}

set_task(0.2, "cmdUsp", id);

return HC_CONTINUE;
}

public rgFlPlayerFallDamage(id) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return HC_CONTINUE
Expand All @@ -249,6 +390,41 @@ public rgFlPlayerFallDamage(id) {
return HC_CONTINUE;
}

public fmAddToFullPack(es, e, iEnt, id, hostflags, player, pSet) {
if (hns_get_mode() != MODE_TRAINING && hns_get_state() != STATE_PAUSED) {
return FMRES_IGNORED;
}

if (id == iEnt)
return FMRES_IGNORED;

if (player) {
set_es(es, ES_Solid, SOLID_NOT);

if (is_user_alive(iEnt)) {
if (g_bInvisPlayers[id]) {
set_es(es, ES_RenderMode, kRenderTransTexture);
set_es(es, ES_RenderAmt, 0);
set_es(es, ES_Origin, { 999999999.0, 999999999.0, 999999999.0 });
}
}
}

return FMRES_IGNORED;
}


public plugin_end() {
DestroyForward(g_hResetBugForward);
}

stock give_user_item(id, const szWeapon[], numBullets, GiveType:giveType = GT_APPEND) {
if (!is_user_alive(id)) return;

new iWeapon = rg_give_item(id, szWeapon, giveType);

if (!is_nullent(iWeapon) && iWeapon != -1) {
rg_set_iteminfo(iWeapon, ItemInfo_iMaxClip, numBullets);
rg_set_user_ammo(id, rg_get_weapon_info(szWeapon, WI_ID), numBullets);
}
}
10 changes: 10 additions & 0 deletions scripting/include/hns-match/addition/cmds.inc
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@ public cmdStartMatch(id) {
return PLUGIN_HANDLED;
}

if (task_exists(TASK_STARTED)) {
remove_task(TASK_STARTED);
}

if (task_exists(TASK_WAIT)) {
remove_task(TASK_WAIT);
}

chat_print(0, "%l", "START_MIX", id);

mix_start();
Expand All @@ -370,6 +378,8 @@ public cmdKnifeRound(id) {
return PLUGIN_HANDLED;
}

chat_print(id, "%L", id, "START_KNIFE_1");

g_iMatchStatus = MATCH_TEAMKNIFE;
kniferound_start();

Expand Down
2 changes: 1 addition & 1 deletion scripting/include/hns-match/gameplay/gameplay_hns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public NadesHandler(id, hMenu, item)
}
}

if (g_iSettings[FLASH] >= 1)
if (g_iSettings[SMOKE] >= 1)
{
if (user_has_weapon(id, CSW_SMOKEGRENADE))
{
Expand Down
4 changes: 4 additions & 0 deletions scripting/include/hns-match/globals.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#define TASK_TIMER 54345
#define HUD_PAUSE 23931

#define TASK_WAIT 12319
#define TASK_STARTED 13339


new g_PluginId;

enum NATCH_RULES {
Expand Down
3 changes: 0 additions & 3 deletions scripting/include/hns-match/modes/mode_manager.inl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
const TASK_WAIT = 12319;
const TASK_STARTED = 13339;

new Float:flWaitPlayersTime;

public mode_init() {
Expand Down
Loading

0 comments on commit 5f3a5c1

Please sign in to comment.