plmenu for jailbreak

Сообщения
17
Реакции
-1
Ошибка
Ошибок нет.
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:12:29 Aug 29 2013 (6153)
ReGamedll
Нет.
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
description      stat pend  file                      vers         src  load  unload
[ 1] LocalizeBug Fix RUN - localizebugfix.so v2.4 ini Start Never
[ 2] dproto_EF RUN - dproto.so v0.9.582 ini Start Never
[ 3] AMX Mod X RUN - amxmodx.so v1.9.0.5263 ini Start ANY
[ 4] VoiceTranscoder RUN - vtc.so v2017RC5 ini ANY
[ 5] POD-Bot mm RUN - podbot_mm_i386.so vV3B22 ini ANY
[ 6] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl3 ANY
[ 7] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl3 ANY
[ 8] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl3 ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl3 ANY
[10] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[11] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl3 ANY ANY
12 plugins, 12 running
Список плагинов
name                    version     author            file             status   
[ 1] Admin Loader v3.5 neygomon admin_loader.am running
[ 2] FreshBans v1.4.5b kanagava fresh_bans.amxx running
[ 3] Admin Chat v1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 4] Admin Commands v1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 5] Anti Flood v1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 6] Commands Menu v1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 7] Info. Messages v1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 8] Menus Front-End v1.9.0.5263 AMXX Dev Team menufront.amxx running
[ 9] Maps Menu v1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 10] NextMap v1.9.0.5263 AMXX Dev Team nextmap.amxx stopped
[ 11] Nextmap Chooser v1.9.0.5263 AMXX Dev Team mapchooser.amxx stopped
[ 12] Players Menu v1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 13] Plugin Menu v1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 14] Restrict Weapons v1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 15] TimeLeft v1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 16] Scrolling Message v1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 17] Admin Votes v1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 18] CS Misc. Stats v1.9.0.5263 AMXX Dev Team miscstats.amxx running
[ 19] CS Stats Logging v1.9.0.5263 AMXX Dev Team stats_logging.a running
[ 20] Stats Configuration v1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 21] [M-JBE v3.5] Core v2.5 Sanlerus & Hellm jbe_core.amxx running
[ 22] Maps Menu v1.4.1 neugomon jbe_mapsmenu.am running
[ 23] Players Menu v1.8.2 AMXX Dev Team jbe_plmenu.amxx running
[ 24] Map Manager v2.5.54 Mistrick jbe_mapmanager. running
[ 25] Lite Translit v2.9 neygomon && Hell jbe_translit.am running
[ 26] [JBE] Addons: Deathmen v1.2 OverGame jbe_ghost.amxx running
[ 27] HUD Customizer v0.3 Igoreso jbe_hud.amxx running
[ 28] Block MOTD v1.0 Sn!ff3r jbe_motd.amxx running
[ 29] [SJB] Grab v2.1 AlexandrFiner & jbe_grab.amxx running
[ 30] [S_JB] Block Guard on v1.2 OverGame && Hell jbe_guard_block running
[ 31] [S_JB] Chief Marker v3.5 stupok69 & Hellm jbe_chief_marke running
[ 32] [S_JB] Managing Menu v1.0 Hellmith jbe_managing_me running
[ 33] [JBE_DM] Ringolevio v1.1 Freedo.m jbe_dm_ringolev running
[ 34] [JBE_DM] Blindfolders v1.1 ToJI9IHGaa jbe_dm_blindfol running
[ 35] [JailMode] GhostBuster v2.1 AlexandrFiner jbe_dm_ghostbus running
[ 36] [JailMode] Galaxy v1.0 AlexandrFiner jbe_dm_galaxy.a running
[ 37] [JailMode] He v1.1 AlexandrFiner jbe_dm_he.amxx running
[ 38] [JailMode] Hot Potato v1.1 AlexandrFiner jbe_dm_hot_pota running
[ 39] [JBE_DM] Hide And Seek v1.1 Freedo.m jbe_dm_hideands running
[ 40] [JBS] Predator v1.0 Emerald jbe_dm_predator running
[ 41] [JBE_DM] Birth Day v1.1 Freedo.m jbe_dm_birthday running
[ 42] [JBE_DM] Sparta v1.1 Freedo.m jbe_dm_sparta.a running
[ 43] Light v1.0 Author jbe_lights.amxx running
[ 44] [S_JB] Snow v1.0 Hellmith jbe_snow.amxx running
[ 45] Cristmas grenades v1.0 OverGame jbe_ny_grenade. running
[ 46] [S_JB] Objects v1.0 AlexandrFiner jbe_objects.amx running
[ 47] [JBE] Addon: Building v1.0 Hellmith jbe_building.am running
[ 48] Lite Translit v2.8 neygomon lite_translit.a running
[ 49] [JBE] Cases Menu vv1.0 Atom CasesMenu.amxx running
[ 50] [JB ChiefGame] Mafia U vvk/krisiso g3cKpunTop ujbl_cg_mafia.a running
[ 51] Emotions v1.4 LeGioN jbe_emotion.amx running
[ 52] [JB] Boss Menu v[v2.6] Edit By NiKiTa JB_BossMenu.amx running
[ 53] [JBE] Ultimate Bank vvk.com/kri ToJI9IHGaa jbe_bank.amxx running
[ 54] Player Animations Menu v0.1.1 code PomanoB and jbe_dance_menu. running
[ 55] [JBE] Перевод ? v1.0 Hozon jbe_SimonTransl running
[ 56] Teleport Menu v1.0.1 w0w teleport_menu.a running
[ 57] Walls Creator v1.1 d3m37r4 jbe_walls_creat running
[ 58] JB set day v1.0 By thezolotoi && jbe_day_set_a.a running
[ 59] [AMXX] Admin Gift v02.01.2018 Number One jbe_AdminRight. running
[ 60] [UJBL_CG] Question vvk/krisiso g3cKpunTop jbe_cg_question running
[ 61] [UJBL_CG] Truth or lie vvk/krisiso g3cKpunTop jbe_cg_truth_or running
[ 62] Demo Recorder v2.4.1 F@nt0M jbe_demo_record running
[ 63] [ZP] Extra: Dual Deagl v1.0 LARS-DAY[BR]EAKE jbe_weapon_ddea running
[ 64] [AMXX] Weapon: Stinger v1.0.2 xUnicorn (t3rkec jbe_stinger.amx running
[ 65] mkod_show_bullet_damag v1.0 MKOD jbe_damager.amx running
[ 66] ZP Extraitem: M950 Att v1.0 Base: Batcon & t jbe_m950se.amxx running
[ 67] [ZMO] Weapon: Skull-11 v0.1 Chrescoe1 jbe_skull11.amx running
[ 68] [CSO] Dart Pistol v1.0 Dias jbe_DartPistol. running
[ 69] [ZP] Extra: CSO Weapon v1.0 KORD_12.7 jbe_Crow9.amxx running
[ 70] [ZP] Weapon: AK47 Beas v1.0 | 2018 xUnicorn (t3rkec jbe_ak47_beast. running
[ 71] [ZP] Extra: CSO Weapon v1.1 KORD_12.7 jbe_awpz.amxx running
[ 72] [ZP] Addon: AWP Dragon v1.0 Crock / Lars ReE jbe_thunder.amx running
72 plugins, 70 running
Автор плагина
AMXX Dev Team
Версия плагина
AMXX_VERSION_STR
Исходный код
#include <amxmodx>
#include <amxmisc>

native jbe_get_user_team(id);
native jbe_set_user_team(id, iTeam);

/** skip autoloading since it's optional */
#define AMXMODX_NOAUTOLOAD
#include <cstrike>

new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSettings[33]

new g_menuSelect[33][64]
new g_menuSelectNum[33]

#define MAX_CLCMDS 24

new g_clcmdName[MAX_CLCMDS][32]
new g_clcmdCmd[MAX_CLCMDS][64]
new g_clcmdMisc[MAX_CLCMDS][2]
new g_clcmdNum

new g_coloredMenus
new g_cstrike = 0

new Array:g_bantimes;
new Array:g_slapsettings;

new g_CSTeamNames[3][] = {
"JBE_MENU_TEAM_TT",
"JBE_MENU_TEAM_CT",
"JBE_MENU_TEAM_SPEC"
}
new g_CSTeamNumbers[3][] = {
"1",
"2",
"6"
}
new g_CSTeamiNumbers[3] = {
1,
2,
6
}


public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}

public plugin_init()
{
register_plugin("Players Menu", AMXX_VERSION_STR, "AMXX Dev Team")

register_dictionary("common.txt")
register_dictionary("admincmd.txt")

register_clcmd("amx_kickmenu", "cmdKickMenu", ADMIN_KICK, "- displays kick menu")
register_clcmd("amx_banmenu", "cmdBanMenu", ADMIN_BAN, "- displays ban menu")
register_clcmd("amx_slapmenu", "cmdSlapMenu", ADMIN_SLAY, "- displays slap/slay menu")
register_clcmd("amx_teammenu", "cmdTeamMenu", ADMIN_KICK, "- displays team menu")
register_clcmd("amx_clcmdmenu", "cmdClcmdMenu", ADMIN_LEVEL_A, "- displays client cmds menu")

register_menucmd(register_menuid("Ban Menu"), 1023, "actionBanMenu")
register_menucmd(register_menuid("Kick Menu"), 1023, "actionKickMenu")
register_menucmd(register_menuid("Slap/Slay Menu"), 1023, "actionSlapMenu")
register_menucmd(register_menuid("Team Menu"), 1023, "actionTeamMenu")
register_menucmd(register_menuid("Client Cmds Menu"), 1023, "actionClcmdMenu")

register_dictionary("jbe_core.txt")

g_bantimes = ArrayCreate();
// Load up the old default values
ArrayPushCell(g_bantimes, 5);
ArrayPushCell(g_bantimes, 10);
ArrayPushCell(g_bantimes, 15);
ArrayPushCell(g_bantimes, 30);
ArrayPushCell(g_bantimes, 45);
ArrayPushCell(g_bantimes, 60);
ArrayPushCell(g_bantimes, 120);
ArrayPushCell(g_bantimes, 0);


g_slapsettings = ArrayCreate();
// Old default values
ArrayPushCell(g_slapsettings, 0); // First option is ignored - it is slay
ArrayPushCell(g_slapsettings, 0); // slap 0 damage
ArrayPushCell(g_slapsettings, 1);
ArrayPushCell(g_slapsettings, 5);


register_srvcmd("amx_plmenu_bantimes", "plmenu_setbantimes");
register_srvcmd("amx_plmenu_slapdmg", "plmenu_setslapdmg");

g_coloredMenus = colored_menus()

new clcmds_ini_file[64]
get_configsdir(clcmds_ini_file, 63)
format(clcmds_ini_file, 63, "%s/clcmds.ini", clcmds_ini_file)
load_settings(clcmds_ini_file)

if (module_exists("cstrike"))
g_cstrike = 1
}
public plmenu_setbantimes()
{
new buff[32];
new args = read_argc();

if (args <= 1)
{
server_print("usage: amx_plmenu_bantimes <time1> [time2] [time3] ...");
server_print(" use time of 0 for permanent.");

return;
}

ArrayClear(g_bantimes);

for (new i = 1; i < args; i++)
{
read_argv(i, buff, charsmax(buff));

ArrayPushCell(g_bantimes, str_to_num(buff));

}

}
public plmenu_setslapdmg()
{
new buff[32];
new args = read_argc();

if (args <= 1)
{
server_print("usage: amx_plmenu_slapdmg <dmg1> [dmg2] [dmg3] ...");
server_print(" slay is automatically set for the first value.");

return;
}

ArrayClear(g_slapsettings);

ArrayPushCell(g_slapsettings, 0); // compensate for slay

for (new i = 1; i < args; i++)
{
read_argv(i, buff, charsmax(buff));

ArrayPushCell(g_slapsettings, str_to_num(buff));

}

}
public module_filter(const module[])
{
if (equali(module, "cstrike"))
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public native_filter(const name[], index, trap)
{
if (!trap)
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

/* Ban menu */

public actionBanMenu(id, key)
{
switch (key)
{
case 7:
{
/* BEGIN OF CHANGES BY MISTAGEE ADDED A FEW MORE OPTIONS */

++g_menuOption[id]
g_menuOption[id] %= ArraySize(g_bantimes);

g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]);

displayBanMenu(id, g_menuPosition[id])
}
case 8: displayBanMenu(id, ++g_menuPosition[id])
case 9: displayBanMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name[32], name2[32], authid[32], authid2[32]

get_user_name(player, name2, 31)
get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)

new userid2 = get_user_userid(player)

log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%d^")", name, get_user_userid(id), authid, name2, userid2, authid2, g_menuSettings[id])

if (g_menuSettings[id]==0) // permanent
{
new maxpl = get_maxplayers();
for (new i = 1; i <= maxpl; i++)
{
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM");
}
ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_BAN_PERM", name, name2);
}
else
{
new tempTime[32];
formatex(tempTime,sizeof(tempTime)-1,"%d",g_menuSettings[id]);
new maxpl = get_maxplayers();
for (new i = 1; i <= maxpl; i++)
{
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime);
}
ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_BAN_FOR_MIN", name, tempTime, name2);
}
/* ---------- check for Steam ID added by MistaGee --------------------
IF AUTHID == 4294967295 OR VALVE_ID_LAN OR HLTV, BAN PER IP TO NOT BAN EVERYONE */

if (equal("4294967295", authid2)
|| equal("HLTV", authid2)
|| equal("STEAM_ID_LAN", authid2)
|| equali("VALVE_ID_LAN", authid2))
{
/* END OF MODIFICATIONS BY MISTAGEE */
new ipa[32]
get_user_ip(player, ipa, 31, 1)

server_cmd("addip %d %s;writeip", g_menuSettings[id], ipa)
}
else
{
server_cmd("banid %d #%d kick;writeid", g_menuSettings[id], userid2)
}

server_exec()

displayBanMenu(id, g_menuPosition[id])
}
}

return PLUGIN_HANDLED
}

displayBanMenu(id, pos)
{
if (pos < 0)
return

get_players(g_menuPlayers[id], g_menuPlayersNum[id])

new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 7

if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0

new len = format(menuBody, 511, g_coloredMenus ? "%L %L^n^n" : "%L %L^n^n", id, "JBE_MENU_PLMENU_TITLE", id, "JBE_MENU_TITLE_STR", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
new end = start + 7
new keys = MENU_KEY_0|MENU_KEY_8

if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)

if (is_user_bot(i) || (access(i, ADMIN_IMMUNITY) && i != id))
{
++b

if (g_coloredMenus)
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
else
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
} else {
keys |= (1<<b)

if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s\r*^n" : "%L \d%s\r*^n", id, "JBE_KEY", ++b, name)
else
len += format(menuBody[len], 511-len, "%L \w%s^n", id, "JBE_KEY", ++b, name)
}
}

if (g_menuSettings[id])
len += format(menuBody[len], 511-len, "^n%L\w %L^n", id, "JBE_KEY", 8, id, "JBE_MENU_PLMENU_BAN_TIME_MIN", g_menuSettings[id])
else
len += format(menuBody[len], 511-len, "^n%L\w %L^n", id, "JBE_KEY", 8, id, "JBE_MENU_PLMENU_BAN_TIME_PER")

if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n%L \w%L^n%L \w%L", id, "JBE_KEY", 0, id, "JBE_MENU_NEXT", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n%L \w%L", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")

show_menu(id, keys, menuBody, -1, "Ban Menu")
}

public cmdBanMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

g_menuOption[id] = 0

if (ArraySize(g_bantimes) > 0)
{
g_menuSettings[id] = ArrayGetCell(g_bantimes, g_menuOption[id]);
}
else
{
// should never happen, but failsafe
g_menuSettings[id] = 0
}
displayBanMenu(id, g_menuPosition[id] = 0)

return PLUGIN_HANDLED
}

/* Slap/Slay */

public actionSlapMenu(id, key)
{
switch (key)
{
case 7:
{
++g_menuOption[id]

g_menuOption[id] %= ArraySize(g_slapsettings);

g_menuSettings[id] = ArrayGetCell(g_slapsettings, g_menuOption[id]);

displaySlapMenu(id, g_menuPosition[id]);
}
case 8: displaySlapMenu(id, ++g_menuPosition[id])
case 9: displaySlapMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32]

get_user_name(player, name2, 31)

if (!is_user_alive(player))
{
client_print(id, print_chat, "%L", id, "CANT_PERF_DEAD", name2)
displaySlapMenu(id, g_menuPosition[id])
return PLUGIN_HANDLED
}

new authid[32], authid2[32], name[32]

get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)

if (g_menuOption[id])
{
log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, g_menuSettings[id], name2, get_user_userid(player), authid2)

ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_SLAP", name, name2, g_menuSettings[id]);
} else {
log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2)

ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_SLAY", name, name2);
}

if (g_menuOption[id])
user_slap(player, (get_user_health(player) > g_menuSettings[id]) ? g_menuSettings[id] : 0)
else
user_kill(player)

displaySlapMenu(id, g_menuPosition[id])
}
}

return PLUGIN_HANDLED
}

displaySlapMenu(id, pos)
{
if (pos < 0)
return

get_players(g_menuPlayers[id], g_menuPlayersNum[id])

new menuBody[512]
new b = 0
new i
new name[32], team[4]
new start = pos * 7

if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0

new len = format(menuBody, 511, g_coloredMenus ? "%L %L^n^n" : "%L %L^n^n", id, "JBE_MENU_PLMENU_TITLE", id, "JBE_MENU_TITLE_STR", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
new end = start + 7
new keys = MENU_KEY_0|MENU_KEY_8

if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)

if (g_cstrike)
{
if (cs_get_user_team(i) == CS_TEAM_T)
{
copy(team, 3, "TT")
}
else if (cs_get_user_team(i) == CS_TEAM_CT)
{
copy(team, 3, "CT")
} else {
get_user_team(i, team, 3)
}
} else {
get_user_team(i, team, 3)
}

if (!is_user_alive(i) || (access(i, ADMIN_IMMUNITY) && i != id))
{
++b

if (g_coloredMenus)
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
else
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
} else {
keys |= (1<<b)

if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s\r*^n" : "%L \d%s\r*^n", id, "JBE_KEY", ++b, name)
else
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s^n" : "%L \d%s^n", id, "JBE_KEY", ++b, name)
}
}

if (g_menuOption[id])
len += format(menuBody[len], 511-len, "^n%L\w %L^n", id, "JBE_KEY", 8, id, "JBE_MENU_PLMENU_DAMAGE_HP", g_menuSettings[id])
else
len += format(menuBody[len], 511-len, "^n%L\w %L^n", id, "JBE_KEY", 8, id, "JBE_MENU_PLMENU_DAMAGE_KILL")

if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n%L \w%L^n%L \w%L", id, "JBE_KEY", 9, id, "JBE_MENU_NEXT", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n%L \w%L", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")

show_menu(id, keys, menuBody, -1, "Slap/Slay Menu")
}

public cmdSlapMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

g_menuOption[id] = 0
if (ArraySize(g_slapsettings) > 0)
{
g_menuSettings[id] = ArrayGetCell(g_slapsettings, g_menuOption[id]);
}
else
{
// should never happen, but failsafe
g_menuSettings[id] = 0
}

displaySlapMenu(id, g_menuPosition[id] = 0)

return PLUGIN_HANDLED
}

/* Kick */

public actionKickMenu(id, key)
{
switch (key)
{
case 8: displayKickMenu(id, ++g_menuPosition[id])
case 9: displayKickMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
new authid[32], authid2[32], name[32], name2[32]

get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)
get_user_name(player, name2, 31)

new userid2 = get_user_userid(player)

log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, userid2, authid2)

ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_KICK", name, name2);


server_cmd("kick #%d", userid2)
server_exec()

displayKickMenu(id, g_menuPosition[id])
}
}

return PLUGIN_HANDLED
}

displayKickMenu(id, pos)
{
if (pos < 0)
return

get_players(g_menuPlayers[id], g_menuPlayersNum[id])

new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 8

if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0

new len = format(menuBody, 511, g_coloredMenus ? "%L %L^n^n" : "%L %L^n^n", id, "JBE_MENU_PLMENU_TITLE", id, "JBE_MENU_TITLE_STR", pos + 1, (g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0)))
new end = start + 8
new keys = MENU_KEY_0

if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)

if (access(i, ADMIN_IMMUNITY) && i != id)
{
++b

if (g_coloredMenus)
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
else
len += format(menuBody[len], 511-len, "%L \d%s^n", id, "JBE_KEY", b, name)
} else {
keys |= (1<<b)

if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s\r*^n" : "%L \d%s\r*^n", id, "JBE_KEY", ++b, name)
else
len += format(menuBody[len], 511-len, "%L \w%s^n", id, "JBE_KEY", ++b, name)
}
}

if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n%L \w%L^n%L \w%L", id, "JBE_KEY", 9, id, "JBE_MENU_NEXT", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n%L \w%L", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")

show_menu(id, keys, menuBody, -1, "Kick Menu")
}

public cmdKickMenu(id, level, cid)
{
if (cmd_access(id, level, cid, 1))
displayKickMenu(id, g_menuPosition[id] = 0)

return PLUGIN_HANDLED
}

/* Team menu */

public actionTeamMenu(id, key)
{
switch (key)
{
case 7:
{
g_menuOption[id] = (g_menuOption[id] + 1) % (g_cstrike ? 3 : 2);
displayTeamMenu(id, g_menuPosition[id])
}
case 8: displayTeamMenu(id, ++g_menuPosition[id])
case 9: displayTeamMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new authid[32], authid2[32], name[32], name2[32]

get_user_name(player, name2, 31)
get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
get_user_name(id, name, 31)

log_amx("Cmd: ^"%s<%d><%s><>^" transfer ^"%s<%d><%s><>^" (team ^"%s^")", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2, g_menuOption[id] ? "TERRORIST" : "CT")

ChatColor(0, "%L %L", LANG_PLAYER, "JBE_CHAT_PREFIX", LANG_PLAYER, "JBE_CHAT_ALL_ADMIN_TRANSFER", name, name2, LANG_PLAYER, g_CSTeamNames[g_menuOption[id] % 3]);

if (g_cstrike)
{
jbe_set_user_team(player, ((g_menuOption[id] % 3) + 1))
/*if (is_user_alive(player))
{
new deaths = cs_get_user_deaths(player)
user_kill(player, 1)
cs_set_user_deaths(player, deaths)
}
// This modulo math just aligns the option to the CsTeams-corresponding number
cs_set_user_team(player, (g_menuOption[id] % 3) + 1)
cs_reset_user_model(player)*/
} else {
new limit_setting = get_cvar_num("mp_limitteams")

set_cvar_num("mp_limitteams", 0)
engclient_cmd(player, "jointeam", g_CSTeamNumbers[g_menuOption[id] % 2])
engclient_cmd(player, "joinclass", "1")
set_cvar_num("mp_limitteams", limit_setting)
}

if(id != player) displayTeamMenu(id, g_menuPosition[id])
}
}

return PLUGIN_HANDLED
}

displayTeamMenu(id, pos)
{
if (pos < 0)
return

get_players(g_menuPlayers[id], g_menuPlayersNum[id])

new menuBody[512]
new b = 0
new i, iteam
new name[32], team[4]
new start = pos * 7

if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0

new len = format(menuBody, 511, g_coloredMenus ? "%L %L^n^n" : "%L %L^n^n", id, "JBE_MENU_PLMENU_TITLE", id, "JBE_MENU_TITLE_STR", pos + 1, (g_menuPlayersNum[id] / 8 + ((g_menuPlayersNum[id] % 8) ? 1 : 0)))
new end = start + 7
new keys = MENU_KEY_0|MENU_KEY_8

if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)

if (g_cstrike)
{
iteam = jbe_get_user_team(i)

if (iteam == 1)
{
copy(team, 3, "TT")
}
else if (iteam == 2)
{
copy(team, 3, "CT")
}
else if (iteam == 3)
{
copy(team, 3, "SPC");
iteam = 6;
} else {
iteam = get_user_team(i, team, 3)
}
} else {
iteam = get_user_team(i, team, 3)
}

if ((iteam == g_CSTeamiNumbers[g_menuOption[id] % (g_cstrike ? 3 : 2)]) || (access(i, ADMIN_IMMUNITY) && i != id))
{
++b

if (g_coloredMenus)
len += format(menuBody[len], 511-len, "%L \d%s - \r%s^n", id, "JBE_KEY", b, name, team)
else
len += format(menuBody[len], 511-len, "%L \w%s - \r%s^n", id, "JBE_KEY", b, name, team)
} else {
keys |= (1<<b)

if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s\r* \d- \r'%s'^n" : "%L \d%s\r* \d- \r'%s'^n", id, "JBE_KEY", ++b, name, team)
else
len += format(menuBody[len], 511-len, g_coloredMenus ? "%L \w%s \d- \r'%s'^n" : "%L \d%s - \r'%s'^n", id, "JBE_KEY", ++b, name, team)
}
}

len += format(menuBody[len], 511-len, "^n%L\w %L^n", id, "JBE_KEY", 8, id, "JBE_MENU_PLMENU_TEAM_TRANSFER_TO", id, g_CSTeamNames[g_menuOption[id] % (g_cstrike ? 3 : 2)])

if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n%L \w%L^n%L \w%L", id, "JBE_KEY", 9, id, "JBE_MENU_NEXT", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n%L \w%L", id, "JBE_KEY", 0, id, pos ? "JBE_MENU_BACK" : "JBE_MENU_EXIT")

show_menu(id, keys, menuBody, -1, "Team Menu")
}

public cmdTeamMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

g_menuOption[id] = 0

displayTeamMenu(id, g_menuPosition[id] = 0)

return PLUGIN_HANDLED
}

/* Client cmds menu */

public actionClcmdMenu(id, key)
{
switch (key)
{
case 7:
{
++g_menuOption[id]
g_menuOption[id] %= g_menuSelectNum[id]
displayClcmdMenu(id, g_menuPosition[id])
}
case 8: displayClcmdMenu(id, ++g_menuPosition[id])
case 9: displayClcmdMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]

if (is_user_connected(player))
{
new command[512], authid[32], name[32], userid[32]

copy(command, charsmax(command), g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player, authid, 31)
get_user_name(player, name, 31)
num_to_str(get_user_userid(player), userid, 31)

replace(command, charsmax(command), "%userid%", userid)
replace(command, charsmax(command), "%authid%", authid)
replace(command, charsmax(command), "%name%", name)

if (flags & 1)
{
server_cmd("%s", command)
server_exec()
} else if (flags & 2)
client_cmd(id, "%s", command)
else if (flags & 4)
client_cmd(player, "%s", command)
}

if (flags & 8)
displayClcmdMenu(id, g_menuPosition[id])
}
}

return PLUGIN_HANDLED
}

displayClcmdMenu(id, pos)
{
if (pos < 0)
return

get_players(g_menuPlayers[id], g_menuPlayersNum[id])

new menuBody[512]
new b = 0
new i
new name[32]
new start = pos * 7

if (start >= g_menuPlayersNum[id])
start = pos = g_menuPosition[id] = 0

new len = format(menuBody, 511, g_coloredMenus ? "\y%L\R%d/%d^n\w^n" : "%L %d/%d^n^n", id, "CL_CMD_MENU", pos + 1, (g_menuPlayersNum[id] / 7 + ((g_menuPlayersNum[id] % 7) ? 1 : 0)))
new end = start + 7
new keys = MENU_KEY_0|MENU_KEY_8

if (end > g_menuPlayersNum[id])
end = g_menuPlayersNum[id]

for (new a = start; a < end; ++a)
{
i = g_menuPlayers[id][a]
get_user_name(i, name, 31)

if (!g_menuSelectNum[id] || (access(i, ADMIN_IMMUNITY) && i != id))
{
++b

if (g_coloredMenus)
len += format(menuBody[len], 511-len, "\d%d. %s^n\w", b, name)
else
len += format(menuBody[len], 511-len, "#. %s^n", name)
} else {
keys |= (1<<b)

if (is_user_admin(i))
len += format(menuBody[len], 511-len, g_coloredMenus ? "%d. %s \r*^n\w" : "%d. %s *^n", ++b, name)
else
len += format(menuBody[len], 511-len, "%d. %s^n", ++b, name)
}
}

if (g_menuSelectNum[id])
len += format(menuBody[len], 511-len, "^n8. %s^n", g_clcmdName[g_menuSelect[id][g_menuOption[id]]])
else
len += format(menuBody[len], 511-len, "^n8. %L^n", id, "NO_CMDS")

if (end != g_menuPlayersNum[id])
{
format(menuBody[len], 511-len, "^n9. %L...^n0. %L", id, "MORE", id, pos ? "BACK" : "EXIT")
keys |= MENU_KEY_9
}
else
format(menuBody[len], 511-len, "^n0. %L", id, pos ? "BACK" : "EXIT")

show_menu(id, keys, menuBody, -1, "Client Cmds Menu")
}

public cmdClcmdMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

g_menuSelectNum[id] = 0

for (new a = 0; a < g_clcmdNum; ++a)
if (access(id, g_clcmdMisc[a][0]))
g_menuSelect[id][g_menuSelectNum[id]++] = a

g_menuOption[id] = 0

displayClcmdMenu(id, g_menuPosition[id] = 0)

return PLUGIN_HANDLED
}

load_settings(szFilename[])
{
if (!file_exists(szFilename))
return 0

new text[256], szFlags[32], szAccess[32]
new a, pos = 0

while (g_clcmdNum < MAX_CLCMDS && read_file(szFilename, pos++, text, 255, a))
{
if (text[0] == ';') continue

if (parse(text, g_clcmdName[g_clcmdNum], 31, g_clcmdCmd[g_clcmdNum], 63, szFlags, 31, szAccess, 31) > 3)
{
while (replace(g_clcmdCmd[g_clcmdNum], 63, "\'", "^""))
{
// do nothing
}

g_clcmdMisc[g_clcmdNum][1] = read_flags(szFlags)
g_clcmdMisc[g_clcmdNum][0] = read_flags(szAccess)
g_clcmdNum++
}
}

return 1
}

stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^4"); // Зелёный
replace_all(msg, 190, "!y", "^1"); // Стандартный
replace_all(msg, 190, "!t", "^3"); // Цвет команды

if (id) players[0] = id; else get_players(players, count, "ch");
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
При переводе за другую команду через amx_teammenu, переводит, но остаётся исходная команда. (Перевожу T за команду CT, T остаётся Т, но уже в команде CT. При переводе за любую команду такая-же проблема)
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Судя по коду, перевод осуществляет натив jbe_set_user_team, так что вопросы скорее к JBE Core, или откуда там этот натив.
 
Сообщения
673
Реакции
242
Помог
11 раз(а)
проверьте основные квары для мода;
Код:
mp_autoteambalance 0
mp_limitteams 999
 

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

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