Выдача Привилегий

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
418
Реакции
-7
Предупреждения
8
Ошибка
L 04/01/2023 - 22:35:17: [AMXX] Displaying debug trace (plugin "AdminRight.amxx", version "02.01.2018")
L 04/01/2023 - 22:35:17: [AMXX] Run time error 4: index out of bounds
L 04/01/2023 - 22:35:17: [AMXX] [0] AdminRight.sma::Show_PlayerMenu (line 254)
L 04/01/2023 - 22:35:17: [AMXX] [1] AdminRight.sma::Handle_PlayerMenu (line 278)
ОС
Windows
Amx Mod X
1.9.0
Билд
Protocol version 48
Exe version 1.1.2.6/2.0.0.0 (cstrike)
Exe build: 16:05:41 Jun 15 2009 (45
ReGamedll
-
Версия Metamod
Metamod v1.20
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5 ini Start ANY
[ 2] POD-Bot mm RUN - podbot_mm.dll v3.0B20b ini Chlvl ANY
[ 3] Print Center Fi RUN - printcenterfix_m v2.0.1 ini ANY ANY
[ 4] CStrike RUN - cstrike_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 5] Fun RUN - fun_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dl v1.9.0.5 pl1 ANY ANY
[ 7] Engine RUN - engine_amxx.dll v1.9.0.5 pl1 ANY ANY
[ 8] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl1 ANY ANY
8 plugins
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Admin Base 1.9.0.5294 AMXX Dev Team admin.amxx running
[ 2] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 3] Admin Help 1.9.0.5294 AMXX Dev Team adminhelp.amxx running
[ 4] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 5] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 6] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 7] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 8] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 9] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 10] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 11] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 12] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 13] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 14] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 15] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 16] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 17] Nextmap Chooser 1.9.0.5294 AMXX Dev Team mapchooser.amxx running
[ 18] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 19] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 20] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 21] POD-Bot Menu 1.3 g4s|figurE.09 amxx_podbotmenu running
[ 22] menu privilegij enu privil nu privilegij menu_privilegij running
[ 23] moi kobinet oi kobinet i kobinet my_kabinet.amxx running
[ 24] Camera Changer 1.3 Bl0ck Camera_Changer. running
[ 25] Admin Prefixes 3.0 m0skVi4a ;] AdminPrefixes.a running
[ 26] [AMXX] Admin Gift 02.01.2018 Number One AdminRight.amxx debug
[ 27] NadeModes 11.2 Nomexous & OT nademodes.amxx running
[ 28] KH_HEALTH 1.0 Kulogram KH_Health.amxx running
[ 29] unknown unknown unknown creator_give_we bad load
[ 30] ZM VIP 1.9.1 BETA aaarnas zm_vip.amxx running
[ 31] [ZP] Core/Engine 5.0.8 ZP Dev Team zp50_core.amxx running
[ 32] [AMXX] External Settin 0.1 WiLS amx_settings_ap running
[ 33] [CS] Player Models API 1.2 WiLS cs_player_model running
[ 34] [CS] Teams API 1.2 WiLS cs_teams_api.am running
[ 35] [CS] MaxSpeed API 1.0 WiLS cs_maxspeed_api running
[ 36] [CS] Weapon Models API 1.1 WiLS cs_weap_models_ running
[ 37] [CS] Weapons Restrict 0.4 WiLS cs_weap_restric running
[ 38] [CS] Ham Hooks for Bot 1.0 WiLS cs_ham_bots_api running
[ 39] [ZP] Class: Zombie 5.0.8 ZP Dev Team zp50_class_zomb running
[ 40] [ZP] Class: Human 5.0.8 ZP Dev Team zp50_class_huma running
[ 41] [ZP] Class: Nemesis 5.0.8 ZP Dev Team zp50_class_neme running
[ 42] [ZP] Class: Survivor 5.0.8 ZP Dev Team zp50_class_surv running
[ 43] [ZP] Class: Zombie: Cl 5.0.8 ZP Dev Team zp50_class_zomb running
[ 44] [CSO:Hunter Zombie] 1.2 HoRRoR/tERoR edi zp50_class_chin running
[ 45] NST Zombie Class Heal 1.0 NST zp50_class_sham running
[ 46] [ZP] Wallclimb 1.0 WallClimb by Pyt zp50_class_skal running
[ 47] [ZP] Zombie Class: Dra 0.1 =), LARS-BLOODLI zp50_class_reve running
[ 48] [ZP] Zombie Class: Rev 1.0 =), LARS-BLOODLI zp50_class_reve running
[ 49] [ZP] Zombie Class: Poi 0.1 =), LARS-BLOODLI zp50_class_reve running
[ 50] [ZP] Class: Human: Cla 5.0.8 ZP Dev Team zp50_class_huma running
[ 51] [ZP] Human Armor 5.0.8 ZP Dev Team zp50_human_armo running
[ 52] [ZP] Game Modes Manage 5.0.8 ZP Dev Team zp50_gamemodes. running
[ 53] [ZP] Game Mode: Infect 5.0.8 ZP Dev Team zp50_gamemode_i paused
[ 54] [ZP] Game Mode: Multip 5.0.8 ZP Dev Team zp50_gamemode_m paused
[ 55] [ZP] Game Mode: Swarm 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 56] [ZP] Game Mode: Nemesi 5.0.8 ZP Dev Team zp50_gamemode_n paused
[ 57] [ZP] Game Mode: Surviv 5.0.8 ZP Dev Team zp50_gamemode_s paused
[ 58] [ZP] Game Mode: Plague 5.0.8 ZP Dev Team zp50_gamemode_p paused
[ 59] [ZP] Game Mode: Armage 5.0.8 ZP Dev Team zp50_gamemode_a paused
[ 60] [ZP] Items Manager 5.0.8 ZP Dev Team zp50_items.amxx running
[ 61] [ZP] Items Manager: Am 5.0.8 ZP Dev Team zp50_items_ammo running
[ 62] [ZP] Item: Weapons 5.0.8 ZP Dev Team zp50_item_weapo running
[ 63] [ZP] Item: Nightvision 5.0.8 ZP Dev Team zp50_item_night running
[ 64] [ZP] Item: Antidote 5.0.8 ZP Dev Team zp50_item_antid running
[ 65] [ZP] Item: Zombie Madn 5.0.8 ZP Dev Team zp50_item_zombi running
[ 66] [ZP] Item: Infection B 5.0.8 ZP Dev Team zp50_item_infec running
[ 67] [ZP] Admin Commands 5.0.8 ZP Dev Team zp50_admin_comm running
[ 68] [ZP] Admin Menus 5.0.8 ZP Dev Team zp50_admin_menu running
[ 69] [ZP] Admin Models 5.0.8 ZP Dev Team zp50_admin_mode running
[ 70] [ZP] Custom Buy Menus 5.0.8 ZP Dev Team zp50_buy_menus. running
[ 71] [ZP] Buyzones 5.0.8 ZP Dev Team zp50_buy_zones. running
[ 72] [ZP] Rewards: Ammo Pac 5.0.8 ZP Dev Team zp50_rewards_am running
[ 73] [ZP] Rewards: Frags & 5.0.8 ZP Dev Team zp50_rewards_fr running
[ 74] [ZP] Deathmatch 5.0.8 ZP Dev Team zp50_deathmatch running
[ 75] [ZP] Random Spawning 5.0.8 ZP Dev Team zp50_random_spa running
[ 76] [ZP] Spawn Protection 5.0.8 ZP Dev Team zp50_spawn_prot running
[ 77] [ZP] Zombie Features 5.0.8 ZP Dev Team zp50_zombie_fea running
[ 78] [ZP] Zombie Sounds 5.0.8 ZP Dev Team zp50_zombie_sou running
[ 79] [ZP] Zombie Damage 5.0.8 ZP Dev Team zp50_zombie_dam running
[ 80] [ZP] Human Unlimited A 5.0.8 ZP Dev Team zp50_human_ammo running
[ 81] [ZP] Flashlight 5.0.8 ZP Dev Team zp50_flashlight running
[ 82] [ZP] Nightvision 5.0.8 ZP Dev Team zp50_nightvisio running
[ 83] [ZP] Leap/Longjump 5.0.8 ZP Dev Team zp50_leap.amxx running
[ 84] [ZP] Pain Shock Free 5.0.8 ZP Dev Team zp50_painshockf running
[ 85] [ZP] Knockback 5.0.8 ZP Dev Team zp50_knockback. running
[ 86] [ZP] Weapon Drop/Strip 5.0.8 ZP Dev Team zp50_weapon_dro running
[ 87] [ZP] Effects: Infect 5.0.8 ZP Dev Team zp50_effects_in running
[ 88] [ZP] Effects: Cure 5.0.8 ZP Dev Team zp50_effects_cu running
[ 89] [ZP] Effects: Lighting 5.0.8 ZP Dev Team zp50_effects_li running
[ 90] [ZP] Ambience Effects 5.0.8 ZP Dev Team zp50_ambience_e running
[ 91] [CSO] Thunderbolt 3.0 Dias cso_extra_thund running
[ 92] New Jetpack 0.0.3 Bad_Bud,ZmOutSta NewJP_mu.amxx running
[ 93] [CSO] PlasmaGun 1.0 Dias Leon cso_extra_Plasm running
[ 94] [ZP] Extra Item: Frost 1.4 Raheem zp_frost_m4a1.a running
[ 95] [WPN] Ethereal 1.0 Chrescoe1 wpn_ethereal.am running
[ 96] [ZP] Main Menu 5.0.8 ZP Dev Team zp50_main_menu. running
[ 97] [ZP] Objective Remover 5.0.8 ZP Dev Team zp50_objective_ running
[ 98] [ZP] Gameplay Fixes 5.0.8 ZP Dev Team zp50_gameplay_f running
[ 99] [ZP] Team Scoring 5.0.8 ZP Dev Team zp50_team_scori running
[100] [ZP] Server Browser In 5.0.8 ZP Dev Team zp50_serverbrow running
[101] [ZP] HUD Information 5.0.8 ZP Dev Team zp50_hud_info.a running
[102] [ZP] Ammo Packs 5.0.8 ZP Dev Team zp50_ammopacks. running
[103] [ZP] Grenade: Fire 5.0.8 ZP Dev Team zp50_grenade_fi running
[104] [ZP] Grenade: Frost 5.0.8 ZP Dev Team zp50_grenade_fr running
[105] [ZP] Grenade: Flare 5.0.8 ZP Dev Team zp50_grenade_fl running
[106] [ZP] ZP 4.3 Subplugin 5.0.8 ZP Dev Team zp50_zp43_compa running
[107] [ZP] Can Auto Save Amm 0.1.0 ZombArena.Ru zp_save.amxx running
[108] [ZP] Addon: Knifes NEW Mr.TheFold, reda zp_addon_knifes running
[109] [ZP] Sub-Plugin: Parac 1.1 Random1, 93()|29 zbg_addons_para running
[110] New ZP Ammo-Menu 0.1 Sanya@ zp_ammomenu.amx running
[111] [ZP] ZP++ Ice Cube 1.0 DareDevil (Gyiov zp50_ice_cube.a running
[112] [ZP]Level System 6.0 Dambas zp_level_system running
[113] [ZP] Admin Lvl Menu 1.0 Dambas zp_level_admin_ running
[114] No Survivor Recoil v1.0 Stone/Mog zp_no_survivor. running
[115] Vip Menu ip Menu p Menu zp_vip_menu.amx running
[116] Super Vip Menu uper Vip M per Vip Menu zp_supervip_men running
[117] Owner Menu wner Menu ner Menu zp_owner_menu.a running
[118] Creator Menu reator Men eator Menu zp_creator_menu running
[119] [CSO] M4A1 Dark Knight 1.0 || CLO AsepKhairulAnam@ buff_buffm4.amx running
Автор плагина
Number One
Версия плагина
02.01.2018
Исходный код
#include <amxmodx>
#include <amxmisc>

// -> Инфо о плагине <- //{
new g_Plugin[] = "[AMXX] Admin Gift";
new g_Version[] = "02.01.2018";
new g_Author[] = "Number One";
// -> Инфо о плагине <- //}

const PLAYERS_PER_PAGE = 8; // Игроков на одной странице (9 - далее | 0 - выход)
const RIGHT_PER_PAGE = 7;

new g_iMenuPlayers[33][32], g_iMenuPosition[33];
new Admin[32], Player[32];
new Password[64];
new szPassword[33][64];
new g_iRight[33], g_iTake[33], Target[33];

// Список администраторов
enum _:DATA_ADMIN_LIST { RIGHT[64], FLAGS[64] }
new Array:g_aAdminList;
new g_iAdminListSize;

// Users
new g_LoadList[81]
new szParse[128]
new szParseUser[64]
new szLine, szNum
new szBlock[512];

new flags_admin_right, flags_admin_take, type_admin_right, type_admin_take;

// Срок
new g_Time[33];
new const g_szTime[] = { 1, 7, 15, 30, 90 };

public plugin_init()
{
register_plugin(g_Plugin, g_Version, g_Author);

register_menucmd(register_menuid("Show_MainMenu"), (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "Handle_MainMenu");
register_menucmd(register_menuid("Show_PlayerMenu"), (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "Handle_PlayerMenu");
register_menucmd(register_menuid("Show_ConfirmMenu"), (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9), "Handle_ConfirmMenu");

register_clcmd("admin_right", "ClientCmd");
register_clcmd("write_reason", "Command_WriteReason");

flags_admin_right = register_cvar("gp_admin_right", "l"); // Флаг админа, который может выдать привилегии
flags_admin_take = register_cvar("gp_admin_take", "l"); // Флаг админа, который может забрать привилегии
type_admin_right = register_cvar("gp_type_admin_right", "1"); // Привилегию в users.ini [ 1 - Записывать | 0 - выдать на карту ]
type_admin_take = register_cvar("gp_type_admin_take", "1"); // Привилегию в users.ini [ 1 - Отключать навсегда | 0 - выключить на карту ]
server_cmd("exec addons/amxmodx/configs/OnlineRight/main.cfg");
register_dictionary("right_key_menu.txt");
admin_remove();
}

public plugin_precache()
{
new szCfgDir[64], szCfgFile[128];
get_localinfo("amxx_configsdir", szCfgDir, charsmax(szCfgDir));
// Получаем список Привилегий
formatex(szCfgFile, charsmax(szCfgFile), "%s/OnlineRight/privilege.ini", szCfgDir);
switch(file_exists(szCfgFile))
{
case 0:
{
write_file(szCfgFile, "; ^"Название привилегии^" ^"флаг^"");
}
case 1:
{
new aDataAdminLIST[DATA_ADMIN_LIST], szBuffer[128], iLine, iLen;
g_aAdminList = ArrayCreate(DATA_ADMIN_LIST);
while(read_file(szCfgFile, iLine++, szBuffer, charsmax(szBuffer), iLen))
{
if(!iLen || szBuffer[0] == ';') continue;
parse
(
szBuffer,
aDataAdminLIST[RIGHT], charsmax(aDataAdminLIST[RIGHT]),
aDataAdminLIST[FLAGS], charsmax(aDataAdminLIST[FLAGS])
);
ArrayPushArray(g_aAdminList, aDataAdminLIST);
}
g_iAdminListSize = ArraySize(g_aAdminList);
}
}
// Получаем список админов
new g_LoadDir[81]
get_configsdir(g_LoadDir, charsmax(g_LoadDir))

formatex(g_LoadList, charsmax(g_LoadList), "%s/users.ini", g_LoadDir)

if(!file_exists(g_LoadList))
{
write_file(g_LoadList, "; Список Администраторов");
}
}

public admin_remove()
{
new text_s[256], m_date[12], line, len
read_file("/addons/amxmodx/configs/users.ini", line, text_s, charsmax(text_s), len)
trim(text_s)

get_time("%Y.%m.%d", m_date, charsmax(m_date))

if(equal(text_s,m_date)) return;
else write_file("/addons/amxmodx/configs/users.ini", m_date, line);

new admin[32], pass[32], flags[32], x_access[32], x_days[32],bufferd[128], days
new iFiled = fopen("/addons/amxmodx/configs/users.ini","r");

while(!feof(iFiled))
{
fgets(iFiled,bufferd,255)
trim(bufferd)

if(bufferd[0]=='"')
{
parse(bufferd, admin, 31, pass, 31, flags, 31, x_access, 31, x_days, 31)

days=str_to_num(x_days)-1

if(days) formatex(text_s, charsmax(text_s), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%d^"", admin, pass, flags, x_access, days)
else formatex(text_s, charsmax(text_s), ";^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%d^"", admin, pass, flags, x_access, days)

if(line) write_file("/addons/amxmodx/configs/users.ini", text_s, line)
}
line++
}

fclose(iFiled)
server_cmd("amx_reloadadmins");
}

public Command_WriteReason(id)
{
read_argv(1, Password, charsmax(Password));
if(!equal(Password, ""))
{
copy(szPassword[id], charsmax(szPassword[]), Password);
return Show_ConfirmMenu(id);
}
else
{
ColorChat(id, "%L!y Пароль не может быть пустой!.", id, "PREFIX_CHAT");
client_cmd(id, "messagemode ^"write_reason^"");
}

return PLUGIN_HANDLED;
}

public ClientCmd(id)
{
g_iRight[id] = 0;
g_iTake[id] = 0;
Target[id] = 0;
Show_MainMenu(id, g_iMenuPosition[id] = 0);
}

Show_MainMenu(id, iPos)
{
new g_szFlagsRight[64], g_szFlagsTake[64]
get_pcvar_string(flags_admin_right, g_szFlagsRight, charsmax(g_szFlagsRight));
get_pcvar_string(flags_admin_take, g_szFlagsTake, charsmax(g_szFlagsTake));
if(iPos < 0) return PLUGIN_HANDLED;
new iStart = iPos * RIGHT_PER_PAGE;
if(iStart > g_iAdminListSize) iStart = g_iAdminListSize;
iStart = iStart - (iStart % RIGHT_PER_PAGE);
g_iMenuPosition[id] = iStart / RIGHT_PER_PAGE;
new iEnd = iStart + RIGHT_PER_PAGE;
if(iEnd > g_iAdminListSize) iEnd = g_iAdminListSize;
new szMenu[512], iLen, iPagesNum = (g_iAdminListSize / RIGHT_PER_PAGE + ((g_iAdminListSize % RIGHT_PER_PAGE) ? 1 : 0));
new iKeys = (1<<9), b;
if(get_user_flags(id) & read_flags(g_szFlagsRight)) iLen = formatex(szMenu, charsmax(szMenu), "\yМеню Выдачи Привилегий^n^n", iPos + 1, iPagesNum);
else iLen = formatex(szMenu, charsmax(szMenu), "\yМеню Выдачи Привилегий^n\dВыдача для \y[Создателя]\w^n^n", iPos + 1, iPagesNum);
for(new a = iStart; a < iEnd; a++)
{
new aDataAdminLIST[DATA_ADMIN_LIST];
ArrayGetArray(g_aAdminList, a, aDataAdminLIST);
if(get_user_flags(id) & read_flags(g_szFlagsRight))
{
iKeys |= (1<<b);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Выдать %s^n", id, "MENU_KEY_DEFAULT", ++b, aDataAdminLIST[RIGHT]);
}
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\d Выдать %s^n", id, "MENU_KEY_DEFAULT", ++b, aDataAdminLIST[RIGHT]);
}
for(new i = b; i < RIGHT_PER_PAGE; i++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");
if(get_user_flags(id) & read_flags(g_szFlagsTake))
{
iKeys |= (1<<7);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Забрать привилегии^n", id, "MENU_KEY_8");
}
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\d Забрать привилегии^n", id, "MENU_KEY_CLOSE");
if(iEnd < g_iAdminListSize)
{
iKeys |= (1<<8);
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n%L \wДальше^n%L \w%s", id, "MENU_KEY_9", id, "MENU_KEY_0", iPos ? "Назад" : "Выход");
}
else formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n%L \w%s", id, "MENU_KEY_0", iPos ? "Назад" : "Выход");
/*formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\r[\y0\r] \w%s", iPos ? "Назад" : "Выход");*/
return show_menu(id, iKeys, szMenu, -1, "Show_MainMenu");
}

public Handle_MainMenu(id, iKey)
{
switch(iKey)
{
case 7:
{
g_iTake[id] = true;
return Show_PlayerMenu(id, g_iMenuPosition[id] = 0);
}
case 8: return Show_MainMenu(id, ++g_iMenuPosition[id]);
case 9: return Show_MainMenu(id, --g_iMenuPosition[id]);
default:
{
g_iRight[id] = g_iMenuPosition[id] * RIGHT_PER_PAGE + iKey;
return Show_PlayerMenu(id, g_iMenuPosition[id] = 0);
}
}
return Show_MainMenu(id, g_iMenuPosition[id]);
}

Show_PlayerMenu(id, iPos)
{
new iPlayersNum;
for(new i = 1; i <= get_maxplayers(); i++)
{
if(!is_user_connected(i))
continue;

g_iMenuPlayers[id][iPlayersNum++] = i;
}
new iStart = iPos * PLAYERS_PER_PAGE;
if(iStart > iPlayersNum) iStart = iPlayersNum;
iStart = iStart - (iStart % PLAYERS_PER_PAGE);
g_iMenuPosition[id] = iStart / PLAYERS_PER_PAGE;
new iEnd = iStart + PLAYERS_PER_PAGE;
if(iEnd > iPlayersNum) iEnd = iPlayersNum;
new szMenu[512], iLen, iPagesNum = (iPlayersNum / PLAYERS_PER_PAGE + ((iPlayersNum % PLAYERS_PER_PAGE) ? 1 : 0));
switch(iPagesNum)
{
case 0:
{
ColorChat(id, "%L!y Нету игроков!", id, "PREFIX_CHAT");
return PLUGIN_HANDLED;
}
default: iLen = formatex(szMenu, charsmax(szMenu), "\yВыберите игрока^n^n", iPos + 1, iPagesNum);
}
new szName[32], i, iKeys = (1<<9), b;
for(new a = iStart; a < iEnd; a++)
{
i = g_iMenuPlayers[id][a];
get_user_name(i, szName, charsmax(szName));
if(i != id)
{
iKeys |= (1<<b);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L \w%s^n", id, "MENU_KEY_DEFAULT", ++b, szName);
}
else iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L \d%s \r[\yЭто вы\r]^n", id, "MENU_KEY_DEFAULT", ++b, szName);
}
for(new i = b; i < 8; i++) iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n");
if(iEnd < iPlayersNum)
{
iKeys |= (1<<8);
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n%L \wДальше^n%L \w%s", id, "MENU_KEY_9", id, "MENU_KEY_0", iPos ? "Назад" : "Выход");
}
else formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n%L \w%s", id, "MENU_KEY_0", iPos ? "Назад" : "Выход");
return show_menu(id, iKeys, szMenu, -1, "Show_PlayerMenu");
}

public Handle_PlayerMenu(id, iKey)
{
switch(iKey)
{
case 8: return Show_PlayerMenu(id, ++g_iMenuPosition[id]);
case 9: return Show_PlayerMenu(id, --g_iMenuPosition[id]);
default:
{
Target[id] = g_iMenuPlayers[id][g_iMenuPosition[id] * PLAYERS_PER_PAGE + iKey];
new aDataAdminLIST[DATA_ADMIN_LIST];
ArrayGetArray(g_aAdminList, g_iRight[id], aDataAdminLIST);
get_user_name(id, Admin, charsmax(Admin));
get_user_name(Target[id], Player, charsmax(Player));
if(g_iTake[id])
{
if(get_pcvar_num(type_admin_take) == 1)
{
set_user_flags(Target[id], read_flags("z"));
remove_user_flags(Target[id], read_flags("abcdefghijklmnopqrstu"));
for(szLine = 0; read_file(g_LoadList, szLine, szParse, charsmax( szParse ), szNum); szLine++)
{
if(szNum > 0 && szParse[0] != ';')
{
parse(szParse, szParseUser, charsmax(szParseUser));
if(equal(Player, szParseUser))
{
formatex(szBlock, charsmax(szBlock), ";%s", szParse);
write_file(g_LoadList, szBlock, szLine);
server_cmd("amx_reloadadmins");
break;
}
}
}
}
else
{
set_user_flags(Target[id], read_flags("z"));
remove_user_flags(Target[id], read_flags("abcdefghijklmnopqrstu"));
}
ColorChat(0,"%L!y Создатель !t%s !yзабрал у !t%s!y -!gвсе привилегии!y.", id, "PREFIX_CHAT", Admin, Player);
return PLUGIN_HANDLED;
}
else
{
if(get_pcvar_num(type_admin_right) == 0)
{
remove_user_flags(Target[id], read_flags("abcdefghijklmnopqrstuz"));
set_user_flags(Target[id], read_flags(aDataAdminLIST[FLAGS]));
ColorChat(0, "%L!y Создатель !t%s !yвыдал игроку!t %s!y -!g%s!y.", id, "PREFIX_CHAT", Admin, Player, aDataAdminLIST[RIGHT]);
return PLUGIN_HANDLED;
}
else
{
client_cmd(id, "messagemode ^"write_reason^"");
ColorChat(id, "%L!y Введите пароль для игрока.", id, "PREFIX_CHAT");
}
}
}
}
return Show_PlayerMenu(id, g_iMenuPosition[id] = 0);
}

Show_ConfirmMenu(id)
{
new aDataAdminLIST[DATA_ADMIN_LIST];
ArrayGetArray(g_aAdminList, g_iRight[id], aDataAdminLIST);
get_user_name(Target[id], Player, charsmax(Player));
new szMenu[512], iLen = 0, iKeys = (1<<2|1<<3|1<<4|1<<9);

iLen = formatex(szMenu, charsmax(szMenu), "\yМеню Выдачи Привилегий \r[\dПодтверждение\r]^n\r[\y#\r]\w Ник:\y%s^n", Player);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Привилегия:\y%s^n", id, "MENU_KEY_1", aDataAdminLIST[RIGHT]);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Пароль:\r %s^n", id, "MENU_KEY_2", szPassword[id]);
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Срок:\y%d дней^n^n", id, "MENU_KEY_3", g_szTime[g_Time[id]]);

iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Подтвердить^n", id, "MENU_KEY_4");
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "%L\w Отменить^n", id, "MENU_KEY_5");
formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n%L\w Выход", id, "MENU_KEY_0");
return show_menu(id, iKeys, szMenu, -1, "Show_ConfirmMenu");
}

public Handle_ConfirmMenu(id, iKey)
{
new aDataAdminLIST[DATA_ADMIN_LIST];
ArrayGetArray(g_aAdminList, g_iRight[id], aDataAdminLIST);
get_user_name(id, Admin, charsmax(Admin));
get_user_name(Target[id], Player, charsmax(Player));
switch(iKey)
{
case 2:
{
++g_Time[id]
if(g_Time[id] >= 5) g_Time[id] = 0
return Show_ConfirmMenu(id);
}
case 3:
{
if(get_pcvar_num(type_admin_right) == 1)
{
for(szLine = 0; read_file(g_LoadList, szLine, szParse, charsmax( szParse ), szNum); szLine++)
{
if(szNum > 0 && szParse[0] != ';')
{
parse(szParse, szParseUser, charsmax(szParseUser));
if(equal(Player, szParseUser))
{
formatex(szBlock, charsmax(szBlock), ";%s", szParse);
write_file(g_LoadList, szBlock, szLine);
}
}
}

remove_user_flags(Target[id], read_flags("abcdefghijklmnopqrstuz"));
set_user_flags(Target[id], read_flags(aDataAdminLIST[FLAGS]));
formatex(szBlock, charsmax(szBlock), "^"%s^" ^"%s^" ^"%s^" ^"a^" ^"%d^"", Admin, szPassword[id], aDataAdminLIST[FLAGS], g_szTime[g_Time[id]])
write_file(g_LoadList, szBlock, -1);
server_cmd("amx_reloadadmins");
ColorChat(0, "%L!y Создатель !t%s !yвыдал игроку!t %s!y -!g %s!y.", id, "PREFIX_CHAT", Admin, Player, aDataAdminLIST[RIGHT]);
}
}
case 4: return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}

stock ColorChat(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();
}
}
}
}
Хелпаните, этот index of bounds покоя не даёт
 
Сообщения
418
Реакции
-7
Предупреждения
8
Ну гляньте, вам что сложно? Проблема скорее всего лёгкая, просто я не в курсе о методах исправления..
 

Ayk

Сообщения
763
Реакции
478
Помог
19 раз(а)
Никто ничем не обязан, надо иметь терпение. Закрываю за АП-ы.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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