- Ошибка
-
Не передает через натив строку
- ОС
- Windows
- Amx Mod X
-
1.9.0
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.10.0.759-dev
Build date: 15:34:13 Jun 22 2021 (2628)
Build from: https://github.com/dreamstalker/rehlds/commit/ad6f6ad
- ReGamedll
-
ReGameDLL version: 5.21.0.540-dev
Build date: 17:32:55 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: 15:47:38 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
[ 1] SafeNameAndChat RUN - safenameandchat.dll v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.0.137 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 4] Revoice RUN - revoice_mm.dll v0.1.0.34 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.9.0.5271 ini Start ANY
[ 6] Rechecker RUN - rechecker_mm.dll v2.5 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 8] Fun RUN - fun_amxx.dll v1.9.0.5271 pl5 ANY ANY
[ 9] Engine RUN - engine_amxx.dll v1.9.0.5271 pl5 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5271 pl5 ANY ANY
[11] GeoIP RUN - geoip_amxx.dll v1.9.0.5271 pl5 ANY ANY
[12] CStrike RUN - cstrike_amxx.dll v1.9.0.5271 pl5 ANY ANY
[13] CSX RUN - csx_amxx.dll v1.9.0.5271 pl5 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5271 pl5 ANY ANY
[15] ReAPI RUN - reapi_amxx.dll v5.21.0.248-dev pl5 ANY Never
[16] MySQL RUN - mysql_amxx.dll v1.9.0.5271 pl5 ANY ANY
16 plugins, 16 running
- Список плагинов
-
[ 1] Block Radio Commands 1.0 d3m37r4 block_radiocmd. running
[ 2] [ReAPI] Hint blocker 0.1.0 F@tn0M reapi_hint_bloc running
[ 3] [ReAPI] Block Fire in 3.1.0 F@nt0M reapi_block_fit running
[ 4] No Bhop and SGS/DDRun 1.1 Denzer no_bhop_sgs.amx running
[ 5] REMOVE CORPSE 2.0 fl0wer | MayroN remove_corpse.a running
[ 6] Admin Base 1.9.0.5271 AMXX Dev Team admin.amxx running
[ 7] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 8] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 9] Slots Reservation 1.9.0.5271 AMXX Dev Team adminslots.amxx running
[ 10] Multi-Lingual System 1.9.0.5271 AMXX Dev Team multilingual.am running
[ 11] Menus Front-End 1.9.0.5271 AMXX Dev Team menufront.amxx running
[ 12] Commands Menu 1.9.0.5271 AMXX Dev Team cmdmenu.amxx running
[ 13] Players Menu 1.9.0.5271 AMXX Dev Team plmenu.amxx running
[ 14] Maps Menu 1.9.0.5271 AMXX Dev Team mapsmenu.amxx running
[ 15] Plugin Menu 1.9.0.5271 AMXX Dev Team pluginmenu.amxx running
[ 16] Admin Chat 1.9.0.5271 AMXX Dev Team adminchat.amxx running
[ 17] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 18] Admin Votes 1.9.0.5271 AMXX Dev Team adminvote.amxx running
[ 19] NextMap 1.9.0.5271 AMXX Dev Team nextmap.amxx running
[ 20] Nextmap Chooser 1.9.0.5271 AMXX Dev Team mapchooser.amxx running
[ 21] TimeLeft 1.9.0.5271 AMXX Dev Team timeleft.amxx running
[ 22] Pause Plugins 1.9.0.5271 AMXX Dev Team pausecfg.amxx running
[ 23] Stats Configuration 1.9.0.5271 AMXX Dev Team statscfg.amxx running
[ 24] Restrict Weapons 1.9.0.5271 AMXX Dev Team restmenu.amxx running
[ 25] StatsX 1.9.0.5271 AMXX Dev Team statsx.amxx running
[ 26] CS Misc. Stats 1.9.0.5271 AMXX Dev Team miscstats.amxx running
[ 27] CS Stats Logging 1.9.0.5271 AMXX Dev Team stats_logging.a running
[ 28] [AMXX] Settings API 1.2 MeRcyLeZZ | Perf amx_settings_ap running
[ 29] Zombie Plague Special 4.5 MeRcyLeZZ | @bdu zombie_plague_s debug
[ 30] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 31] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 32] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 33] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 34] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 35] [ZP] Assassin vs Snipe 1.2 @bdul! | [P]erfe zp_game_mode_as running
[ 36] [ZP] Nightmare Mode 1.3 @bdul! | [P]erfe zp_game_mode_ni running
[ 37] [ZP] Remix Mode 1.4 @bdul! | [P]erfe zpsp_game_mode_ running
[ 38] [ZP] Default Zombie Cl 4.3 Fix5 MeRcyLeZZ zpsp_zombie_cla running
[ 39] [ZP] Human Classes 1.0 Perf. Scrash zpsp_human_clas running
[ 40] Generator Menu 1.0.0 Ragamafona generator_menu. running
[ 41] Choose menu mode 1.0 Robert7791 zp_choose_round debug
[ 42] Knife System 2.1 Oli knifes_system.a running
[ 43] [ZP] Weapon: Minigun ( 4.0 Edit: Ragamafona WPN_Minigun_Nem running
[ 44] TestArrayfile 1.0 Robert7791 atestarray.amxx running
44 plugins, 44 running
- Автор плагина
- TestArrayfile 1.0 Robert7791 (мой плагин)
- Версия плагина
- 1.0
- Исходный код
-
#include <amxmodx>
#include <zpsp_stocks>
#define MAX_PLAYERS 32
new perem[128], primer[128]
enum _:DATA
{
TYPE[2],
AUTH[32],
PREFIX[64]
};
new Array:g_aData, g_aDataSize, g_szPrefix[MAX_PLAYERS + 1][64];
public plugin_init(){
register_plugin("TestArrayfile", "1.0", "Robert7791");
register_clcmd("say /testp", "testpref");
}
public plugin_natives(){
register_native("get_my_priveleges", "native_get_my_priveleges", 0)
}
public native_get_my_priveleges(id){
return perem[id];
}
public client_putinserver(id){
get_prefix(id);
formatex(perem, charsmax(perem), "%s", g_szPrefix[id])
}
public testpref(id){
client_print_color(id, print_team_default, "Ваша привилегия: %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] = "";
}
Всем привет, сделал плагин, который по флагу дает название привилегии (Например: флаг f - VIP). Проблема вот в чем. При входе на сервер выполняется функция, которая записывает в массив имя привилегии(по флагу) (функция get_prefix(id)). Далее, если вызвать через команду /testp, то в чате появиться сообщение о твоей привилегии. А вот в другом плагине (Хочу в меню показ привилегии) либо ничего не показывает, либо менюшка показывает криво текст( если указать return g_szPrefix[id] в нативе) . Что надо указать в нативе, чтобы он возвращал именно текст в другой плагин? Просто локально(при вызове /testp) норм работает. Заранее спасибо!
В этой теме было размещено решение! Перейти к решению.
Вложения
-
81 байт Просмотры: 92