Пропадает часть символов в менюшке

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
11
Реакции
0
Ошибка
https://prnt.sc/u__w_FLBvnLM
ОС
Linux
Amx Mod X
1.9.0
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.11.0.776-dev
Build date: 19:37:50 Apr 20 2022 (2930)
Build from: https://github.com/dreamstalker/rehlds/commit/3dc9f8c
ReGamedll
ReGameDLL version: 5.21.0.540-dev
Build date: 17:33:16 Oct 25 2021
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/b9cccc6
Версия 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
Список метамодулей
[ 1] SafeNameAndChat  RUN   -    safenameandchat.so        v1.1             ini   ANY  
[ 2] Reunion RUN - reunion.so v0.1.0.137 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck.so v0.1.6 ini Start Never
[ 4] Revoice RUN - revoice.so v0.1.0.34 ini Start Never
[ 5] AMX Mod X RUN - amxmodx.so v1.9.0.5263 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip.so v2.3.9 ini ANY
[ 7] HitBox Fix RUN - hitbox_fix.so v1.0.4 ini Start ANY
[ 8] LocalizeBug Fix RUN - localizebugfix.so v2.4 ini Start Never
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.21.0.252-dev pl5 ANY Never
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[11] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[14] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[15] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
Список плагинов
[  1] FreshBans               v1.4.6b      kanagava          fresh_bans.amxx  running  
[ 2] Admin Loader v3.5 neygomon admin_loader.am running
[ 3] Block Radio Commands v1.0 d3m37r4 block_radiocmd. running
[ 4] [ReAPI] Hint blocker v0.1.0 [email protected] reapi_hint_bloc running
[ 5] [ReAPI] Block Fire in v3.1.0 [email protected] reapi_block_fit running
[ 6] No Bhop and SGS/DDRun v1.1 Denzer no_bhop_sgs.amx running
[ 7] REMOVE CORPSE v2.0 fl0wer | MayroN remove_corpse.a running
[ 8] Admin Commands v1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 9] Admin Help v1.9.0.5263 AMXX Dev Team adminhelp.amxx running
[ 10] Commands Menu v1.9.0.5235 AMXX Dev Team cmdmenu.amxx running
[ 11] Players Menu v1.9.0.5235 AMXX Dev Team plmenu.amxx running
[ 12] Maps Menu v1.9.0.5235 AMXX Dev Team mapsmenu.amxx running
[ 13] Admin Chat v1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 14] Admin Votes v1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 15] Pause Plugins v1.9.0.5263 AMXX Dev Team pausecfg.amxx running
[ 16] Stats Configuration v1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 17] Restrict Weapons v1.9.0.5235 AMXX Dev Team restmenu.amxx running
[ 18] [AMXX] Settings API v1.2 MeRcyLeZZ | Perf amx_settings_ap running
[ 19] Zombie Plague Special v4.5 MeRcyLeZZ | @bdu zombie_plague_s debug
[ 20] Chat Manager v1.1.2-16 Mistrick chatmanager.amx running
[ 21] Chat Manager: Addon v0.0.4-70 Mistrick chatmanager_add running
[ 22] [ZPSp] Addon: XP Syste v1.0 Supremache | Per zpsp_xp_system. running
[ 23] [ZPSp] Addon: Item Lim v1.2 WiLS | [P]erfect zpsp_extra_item running
[ 24] [ZP] Plugin: Player Sk v1.1 [P]erfec[T] [S]c zpsp_custom_pla running
[ 25] [ZP] Addon: First Zomb v1.2 [P]erfect [S]cra zpsp_addon_firs running
[ 26] Register System v9.0 m0skVi4a Edit: R RegisterSystem. running
[ 27] zpbank_and_lvl_save_in v1.0 By Robert7791 zpbank_and_lvl_ running
[ 28] [ZPSp] Addon: Vip Syst v1.2 [P]erfec[T] [S]c zpsp_vip_system running
[ 29] [ZP] Assassin vs Snipe v1.2 @bdul! | [P]erfe zp_game_mode_as running
[ 30] [ZP] Nightmare Mode v1.3 @bdul! | [P]erfe zp_game_mode_ni running
[ 31] [ZP] Remix Mode v1.4 @bdul! | [P]erfe zpsp_game_mode_ running
[ 32] VipMenu v1.0 Robert7791 menuvip.amxx running
[ 33] [Customizable] AmxModM v0.0.4 Albertio amxmodmenu.amxx running
[ 34] Choose menu mode v1.0 Robert7791 zp_choose_round debug
[ 35] Generator Menu v1.0.0 Ragamafona generator_menu. running
[ 36] Prefix_in_zmenu v1.0 Robert7791 prefix_in_zmenu running
[ 37] Language Menu v1.0 [email protected] langmenu.amxx running
[ 38] Camera Changer v1.0 Bl0ck & Oli camera_changer_ running
[ 39] VOTEBAN_BY_SLIMSHADY v3.0 SLIMSHADY_MOD voteban_by_slim running
[ 40] [ZP] Extra: Anti-Infec v1.0 MeRcyLeZZ vip_extra_human running
[ 41] [ZP] Default Zombie Cl v4.3 Fix5 MeRcyLeZZ zpsp_zombie_cla running
[ 42] [ZP] Human Classes v1.0 Perf. Scrash zpsp_human_clas running
[ 43] [ZPSp] XP Upgrade: Hea v1.0 Perf. Scrash zpsp_xp_upgrade running
[ 44] [ZPSp] XP Upgrade: Par v1.0 H.RED.ZONE | Per zpsp_xp_upgrade running
[ 45] Map Manager: Core v3.1.4 Mistrick map_manager_cor running
[ 46] Map Manager: Scheduler v0.1.9 Mistrick map_manager_sch running
[ 47] Map Manager: Rtv v0.1.1 Mistrick map_manager_rtv running
[ 48] Map Manager: Nominatio v0.2.0 Mistrick map_manager_nom running
[ 49] Map Manager: BlockList v0.0.4 Mistrick map_manager_blo running
[ 50] Map Manager: Effects v0.1.0 Mistrick map_manager_eff running
[ 51] Map Manager: Informer v0.0.5 Mistrick map_manager_inf running
[ 52] Map Manager: Sounds v0.0.1 Mistrick map_manager_sou running
[ 53] Map Manager: GUI v0.0.6 Mistrick map_manager_gui running
[ 54] Knife System v2.1 Oli knifes_system.a running
[ 55] [ZP] Weapon: Minigun ( v4.0 Edit: Ragamafona WPN_Minigun_Nem running
[ 56] Zp_Survivor_Weapon v1.0 Robert7791 survior_weapon. running
[ 57] [ZP] Extra: CSO Weapon v1.0 KORD_12.7 Weapon_ZhuBajie running
[ 58] No Survivor Recoil vv1.0 Stone/Mog no_survivor_rec running
[ 59] [ReAPI] CMD Kill v0.1 amxx скрип? aax.amxx debug
[ 60] Two Minutes v1.0 Robert7791 atwo_minutes.am running
[ 61] Real Lighting v1.0 Robert7791 real_lighting.a running
Автор плагина
Robert7791
Версия плагина
1.0
Исходный код
#include <amxmodx>

#define MAX_PLAYERS 32

enum _:DATA
{
TYPE[2],
AUTH[32],
PREFIX[512]
};

new Array:g_aData, g_aDataSize, g_szPrefix[MAX_PLAYERS + 1][64];

public plugin_init(){
register_plugin("Prefix_in_zmenu", "1.0", "Robert7791");
}

public plugin_natives(){
register_native("get_my_priveleges", "native_get_my_priveleges", 0)
}

public native_get_my_priveleges(){
enum { param_id = 1, param_string, param_maxlen }

new id = get_param(param_id)

set_string(param_string, g_szPrefix[id], get_param(param_maxlen))

return 1
}

public client_putinserver(id){
get_prefix(id);
formatex(g_szPrefix[id], charsmax(g_szPrefix[]), "%s", g_szPrefix[id])
}

public plugin_cfg()
{
new szCfgDir[64], szCfgFile[128];
get_localinfo("amxx_configsdir", szCfgDir, charsmax(szCfgDir));
formatex(szCfgFile, charsmax(szCfgFile), "%s/prefix_in_zmenu.ini", szCfgDir);
if(file_exists(szCfgFile))
{
new aData[DATA], szBuffer[128],
iLine, iLen, section;
g_aData = ArrayCreate(DATA);
while(read_file(szCfgFile, iLine++, szBuffer, charsmax(szBuffer), iLen))
{
if(!iLen || szBuffer[0] == ';') continue;
if(szBuffer[0] == '[')
{
section++;
continue;
}
switch(section)
{
case 1:
{
parse(szBuffer, aData[TYPE], charsmax(aData[TYPE]), aData[AUTH], charsmax(aData[AUTH]), aData[PREFIX], charsmax(aData[PREFIX]));
ArrayPushArray(g_aData, aData);
}
case 2:
{

}
}
}
g_aDataSize = ArraySize(g_aData);
}
}

stock get_prefix(id)
{
new aData[DATA];
for(new i; i < g_aDataSize; i++)
{
ArrayGetArray(g_aData, i, aData);
switch(aData[TYPE])
{
case 'e':
{
static sName[33]; get_user_name(id, sName, charsmax(sName));
if(!strcmp(aData[AUTH], sName))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), aData[PREFIX]);
}
case 'f':
{
if(get_user_flags(id) & read_flags(aData[AUTH]))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), aData[PREFIX]);
}
case 'i':
{
static sIP[16]; get_user_ip(id, sIP, charsmax(sIP), 1);
if(!strcmp(aData[AUTH], sIP))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), aData[PREFIX]);
}
case 's':
{
static sAuthid[25]; get_user_authid(id, sAuthid, charsmax(sAuthid));
if(!strcmp(aData[AUTH], sAuthid))
return copy(g_szPrefix[id], charsmax(g_szPrefix[]), aData[PREFIX]);
}
}
}
return g_szPrefix[id] = "";
}
После загрузки инфы из ini файла, в менюшке должна появиться соответствующая информация согласно флагу пользователя. Но пропадает часть символов (Вместо VIP пишет IP). Как исправить данную ошибку?

ini
Код:
[Префиксы]
"f" "f" "    Создатель"
"f" "l" "    VIP"
"f" "z" "    Player"
Сама ошибка
1652009590578.png
 
В этой теме было размещено решение! Перейти к решению.
Последнее редактирование:
Сообщения
15
Реакции
4
Помог
1 раз(а)
Покажите нам функцию, где вы вызываете нативу, чтобы вывести сообщение
 
Сообщения
11
Реакции
0
Покажите нам функцию, где вы вызываете нативу, чтобы вывести сообщение
Код:
public show_menu_game(id) { // Game Menu
    static menu[512], len
    len = 0
    new priv[512]
    get_my_priveleges(id, priv, charsmax(priv))
    
    len += formatex(menu[len], charsmax(menu) - len, "%L^n%L^n^n", id, "ZP_MAIN_MENU_TITLE", id, "ZP_MAIN_MENU_TITLE_PRIV", priv[id]) /* Title */
    len += formatex(menu[len], charsmax(menu) - len, "%s %L^n", get_pcvar_num(cvar_buycustom) ? "\r[\y1\r]\w" : "\d[1]", id, "MENU_BUY") /* 1. Buy weapons */
    len += formatex(menu[len], charsmax(menu) - len, "%s %L^n", (get_pcvar_num(cvar_extraitems) && g_isalive[id]) ? "\r[\y2\r]\w" : "\d[2]", id, "MENU_EXTRABUY") /* 2. Extra items */
    len += formatex(menu[len], charsmax(menu) - len, "%s %L^n", get_pcvar_num(cvar_zclasses) ? "\r[\y3\r]\w" : "\d[3]", id, "MENU_ZCLASS") /* 3. Zombie class */
    len += formatex(menu[len], charsmax(menu) - len, "%s %L^n", (g_hclass_i > 1 && get_pcvar_num(cvar_hclasses)) ? "\r[\y4\r]\w" : "\d[4]", id, "MENU_HCLASS") /* 4. Human class */
    
    /* 5. Unstuck */
    ExecuteForward(g_forwards[UNSTUCK_PRE], g_fwDummyResult, id);
    if(g_zombie[id] || !g_zombie[id] && get_pcvar_num(cvar_human_unstuck) || g_fwDummyResult < ZP_PLUGIN_HANDLED) len += formatex(menu[len], charsmax(menu) - len, "\r[\y5\r]\w %L^n", id, "MENU_UNSTUCK")
    else len += formatex(menu[len], charsmax(menu) - len, "\d]5] %L^n", id, "MENU_UNSTUCK")
    
    len += formatex(menu[len], charsmax(menu) - len, "\r[\y6\r]\w %L", id, "MENU_PERSONAL_OPTIONS") /* 6. Personal Options*/
    
    /* 7. Join spec */
    len += formatex(menu[len], charsmax(menu) - len, "\r[\y7\r]\w %L", id, "MENU_AMBRELLA") /* 7. Menu Abmrella*/
    len += formatex(menu[len], charsmax(menu) - len, "\r[\y8\r]\w %L", id, "MENU_PREVILEGES") /* 8. Menu привилегий*/ 
    len += formatex(menu[len], charsmax(menu) - len, "\r[\y0\r]\w %L", id, "MENU_EXIT") /* 0. Exit */
    
    fixAmxMenu(id); // Fix for AMXX custom menus

    show_menu(id, KEYSMENU, menu, -1, "Game Menu")
}
 
Сообщения
15
Реакции
4
Помог
1 раз(а)
priv[id]) /* Title */
->
priv) /* Title */

Почему так? Ну, вы начинаете вывод из определённого символа. Когда вы на сервере один, скорее всего, ваш id = 1, а в массиве 1 - это элемент 2.
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.

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

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