Private message error

Сообщения
290
Реакции
28
Помог
2 раз(а)
Ошибка
L 03/24/2019 - 09:58:12: Start of error session.
L 03/24/2019 - 09:58:12: Info (map "awp_dust") (file "addons/amxmodx/logs/error_20190324.log")
L 03/24/2019 - 09:58:12: Invalid array handle provided (0)
L 03/24/2019 - 09:58:12: [AMXX] Displaying debug trace (plugin "pm.amxx", version "1.0")
L 03/24/2019 - 09:58:12: [AMXX] Run time error 10: native error (native "ArraySize")
L 03/24/2019 - 09:58:12: [AMXX] [0] pm.sma::CmdMain (line 211)
L 03/24/2019 - 09:58:12: [AMXX] [1] pm.sma::BlockHandler (line 408)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5241 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jan 30 2019 07:09:07
Built from: https://github.com/alliedmodders/amxmodx/commit/2110037
Build ID: 5241:2110037
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
Версия 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   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5241 ini Start ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReAPI RUN - reapi_amxx_i386.so v5.8.0.163-dev pl4 ANY Never
[10] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl4 ANY ANY
[11] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl4 ANY Never
[12] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[14] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[15] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[16] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[17] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.9.0.5241 pl4 ANY ANY
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Damager Advanced 1.1.2 Radius (based on damager_advance running
[ 2] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 3] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 4] AES: Informer 0.5 Vega serfreeman1337 aes_informer.am running
[ 5] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 6] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste paused
[ 7] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
[ 8] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 9] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 10] FreshBans 1.4.0b kanagava fresh_bans_140_ running
[ 11] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 12] Lista admini (amx_who) www.play-a Un Biban whobun.amxx running
[ 13] RE Me&HP 1.1 neygomon, AcE re_sayhp.amxx running
[ 14] unknown unknown unknown flash.amxx running
[ 15] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 16] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 17] Admin Base 1.9.0.5241 AMXX Dev Team admin.amxx running
[ 18] Admin Commands 1.9.0.5241 AMXX Dev Team admincmd.amxx debug
[ 19] Commands Menu 1.9.0.5241 AMXX Dev Team cmdmenu.amxx running
[ 20] Menus Front-End 1.9.0.5241 AMXX Dev Team menufront.amxx running
[ 21] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 22] Players Menu 1.9.0.5241 AMXX Dev Team plmenu.amxx running
[ 23] Pause Plugins 1.9.0.5241 AMXX Dev Team pausecfg.amxx running
[ 24] Admin Help 1.9.0.5241 AMXX Dev Team adminhelp.amxx running
[ 25] Multi-Lingual System 1.9.0.5241 AMXX Dev Team multilingual.am running
[ 26] Plugin Menu 1.9.0.5241 AMXX Dev Team pluginmenu.amxx running
[ 27] Admin Votes 1.9.0.5241 AMXX Dev Team adminvote.amxx running
[ 28] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running
[ 29] Private Message 1.0 Denzer pm.amxx debug
[ 30] CSStatsX SQL 0.7.4+1 serfreeman1337 csstatsx_sql.am running
[ 31] CSXSQL: Onlinetime Awa 0.2 serfreeman1337 csstatsx_playti running
[ 32] Items Restrict Ultimat 0.0.4 Vaqtincha items_restrict_ running
[ 33] AES: StatsX 0.5 Vega serfreeman1337 aes_statsx_cstr running
[ 34] Best Player MOTD 1.2.1 OciXCrom crx_bestplayer. running
[ 35] Simple Menu 2.1.1 OciXCrom crx_simplemenu. debug
[ 36] Restricted Names 1.1 Hattrick JM3Ch3R nick.amxx running
[ 37] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 38] Quick and No Scope Det 1.2 EFFx QuickNoScopeD.a running
[ 39] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 40] Advanced Lottery 0.5 Nordic Warrior advanced_lotter debug
[ 41] StatsX 1.9.0.5241 AMXX Dev Team statsx.amxx running
[ 42] Stats Configuration 1.9.0.5241 AMXX Dev Team statscfg.amxx running
[ 43] Advertising Manager 2.0 Javekson advertising_man running
[ 44] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 45] Bomb Count Down HUD/Vo 0.2 RuS Mawe4ka117 bcd_hudvoice_ti running
[ 46] Ping Faker 1.5a MeRcyLeZZ pingfaker_count running
[ 47] unknown unknown unknown fake.amxx running
[ 48] Last Maps Time 0.0.1 Exolent last_maps_time. running
[ 49] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 50] [ReAPI] TopRoundDamage 1.0.5 Dager* *.* -G- damage_round.am running
[ 51] Fall Damage HP Restore 0.0.1 Vaqtincha FallDamageHpRes running
[ 52] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 53] Game Description Advan 1.0 fl0wer gamedesc_advanc running
[ 54] Kills Counter 0.3 serfreeman1337 kills_counter.a running
[ 55] Weapon Icon 1.2 hoboman313/Zenix weapon_icon.amx running
[ 56] Dead Messages 1.1 maFFyoZZyk deadmessages.am stopped
[ 57] Activitate Admini 2.0c Askhanar activitate.amxx running
[ 58] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 59] Auto Round Restart 1.0 LondoN eXtream restartr.amxx running
[ 60] Drop Pistols on Death 0.0.4 Vaqtincha reapi_dead_pist running
[ 61] Simple Online Logger 10.04.18 mx?! simple_online_l running
[ 62] Trial Access 10.04.18 mx?! trial_access.am running
[ 63] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 64] VIP Menu [CS.PLAYARENA 0.15 Leo_[BH](tradus vip_reapi.amxx running
[ 65] Color Flash Screen 1.6.4 Radius (Stimul i color_flash_scr running
[ 66] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 67] Ultimate Fire in the H 2.0 OciXCrom crx_fireintheho running
[ 68] Check Admin & Vip 2.2 Leo_[BH] check_admin_vip running
[ 69] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[ 70] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 71] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 72] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 73] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 74] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 75] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 76] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 77] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 78] Map Manager: Advanced 0.0.4 Mistrick map_manager_adv running
[ 79] Hide HUD/Menu on Vote 1.2.2 d3m37r4 hide_hud_and_me running
[ 80] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 81] Team Select 1.5.0 F@nt0M teamselect.amxx running
[ 82] Force Gag 1.2 zorken zilla_gag.amxx running
[ 83] Parachute 1.1 maeStro | neygom parachute.amxx running
[ 84] [ReAPI:AMXX] Buy Nades 0.1 F@nt0M Buy_Nades_Timeo running
[ 85] Knife Duel with Telepo 1.2 neygomon knife_duel.amxx running
85 plugins, 83 running
Автор плагина
Denzer
Версия плагина
1.0
Исходный код
#include <amxmodx>

#pragma semicolon 1

#define PLUGIN_NAME "Private Message"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Denzer"

// EN: Prefix in chat
// RU: ÐŸÑ€ÐµÑ„Ð¸ÐºÑ Ð² чат
new const PREFIX[] = "[^4PM^1]";

// EN: List of commands to cancel
// RU: СпиÑок команд Ð´Ð»Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ñ‹
new const BLOCK_CMD[] =
{
"cancel",
"otmena",
"отмена"
};

new const g_szLogFile[] = "private_message.log";

new g_iType;
new bool: g_bBlock;
new Float: g_fDelay;
new g_sAccess[24];
new bool: g_bLogging;
new g_iPlayer[MAX_PLAYERS + 1];
new bool: g_bChatBlocked;
new bool: g_bHookSay[MAX_PLAYERS + 1];
new bool: g_bType[MAX_PLAYERS + 1];
new bool: g_bPlayerBlocked[MAX_PLAYERS + 1][MAX_PLAYERS + 1];
new Float: g_fChattingDelay[MAX_PLAYERS + 1];
new Array: g_aIndex[MAX_PLAYERS + 1];

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

new pCvar;
pCvar = create_cvar("pm_type", "1", FCVAR_NONE, "All can write messages each other, 2 - messages can write only: alive to alive, deat for dead, 3 - only to teammates", true, 1.0, true, 3.0);
bind_pcvar_num(pCvar, g_iType);

pCvar = create_cvar("pm_delay", "2.5", FCVAR_NONE, "Time between messages", true, 0.0, true, 10.0);
bind_pcvar_float(pCvar, g_fDelay);

pCvar = create_cvar("pm_access", "m", FCVAR_NONE, "Access flag to function of chat blocking");
bind_pcvar_string(pCvar, g_sAccess, charsmax(g_sAccess));

AutoExecConfig(true, "private_message");

pCvar = create_cvar("pm_block", "1", FCVAR_NONE, "Allows admin to block PM-system", true, 0.0, true, 1.0);
g_bBlock = bool:get_pcvar_num(pCvar);

pCvar = create_cvar("pm_logging", "1", FCVAR_NONE, "Message logging", true, 0.0, true, 1.0);
g_bLogging = bool:get_pcvar_num(pCvar);

register_clcmd("say", "CmdSay");
register_clcmd("say_team", "CmdSay");

for(new i = 0; i < sizeof(BLOCK_CMD); i++)
register_saycmd(BLOCK_CMD[i], "CmdCancel");

if(g_bBlock)
{
register_clcmd("say /pmblock", "CmdMessagesBlock");
register_clcmd("pmblock", "CmdMessagesBlock");
}

register_dictionary("private_message.txt");
}

public client_putinserver(id)
{
g_bHookSay[id] = false;
g_bType[id] = false;
g_aIndex[id] = ArrayCreate();
}

public client_disconnected(id)
{
g_aIndex[id] = Invalid_Array;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!g_aIndex[i])
continue;

new found = ArrayFindValue(g_aIndex[i], id);
if(found != -1)
{
ArrayDeleteItem(g_aIndex[i], found);
}
}
ArrayDestroy(g_aIndex[id]);
}

public CmdSay(id)
{
new szArgs[140];
read_argv(1, szArgs, charsmax(szArgs));
remove_quotes(szArgs);
trim(szArgs);

switch(g_bHookSay[id])
{
case true:
{
new iPlayer = g_iPlayer[id];
if(!is_user_connected(iPlayer))
return PLUGIN_CONTINUE;

replace_wrong_simbols(szArgs);
g_bHookSay[id] = false;
g_fChattingDelay[id] = get_gametime() + g_fDelay;
client_print_color(id, print_team_default, "%L", LANG_SERVER, "PM_MESSAGE_TO", iPlayer, szArgs);
client_print_color(iPlayer, print_team_default, "%L", LANG_SERVER, "PM_MESSAGE_FROM", id, szArgs);

if(g_bLogging)
log_to_file(g_szLogFile, "%L", LANG_SERVER, "PM_WROTE_PLAYER", id, iPlayer, szArgs);

return PLUGIN_HANDLED;
}
case false:
{
new szName[32], szSaveArgs[140];
copy(szSaveArgs, charsmax(szSaveArgs), szArgs);
parse(szArgs, \
szArgs, charsmax(szArgs), \
szName, charsmax(szName));

if(equali(szArgs, "/pm"))
{
if(!szName[0])
{
CmdMain(id);
return PLUGIN_HANDLED;
}

new found_id = find_player("b", szName);
if(found_id)
{
if(id == found_id || is_user_bot(found_id) || is_user_hltv(found_id))
return PLUGIN_HANDLED;

if(g_fChattingDelay[id] > get_gametime())
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_FLOOD");
return PLUGIN_HANDLED;
}

new szReplace[64];
g_fChattingDelay[id] = get_gametime() + g_fDelay;

formatex(szReplace, charsmax(szReplace), "/pm %s ", szName);
replace(szSaveArgs, sizeof(szSaveArgs), szReplace, "");
replace_wrong_simbols(szSaveArgs);

client_print_color(id, print_team_default, "%L", LANG_SERVER, "PM_MESSAGE_TO", found_id, szSaveArgs);
client_print_color(found_id, print_team_default, "%L", LANG_SERVER, "PM_MESSAGE_FROM", id, szSaveArgs);

ArrayPushCell(g_aIndex[id], found_id);
if(ArraySize(g_aIndex[id]) > 3)
{
ArrayDeleteItem(g_aIndex[id], 0);
}

if(g_bLogging)
log_to_file(g_szLogFile, "%L", LANG_SERVER, "PM_WROTE_PLAYER", id, found_id, szArgs);

return PLUGIN_HANDLED;
}
else
{
CmdMain(id);
return PLUGIN_HANDLED;
}
}
}
}
return PLUGIN_CONTINUE;
}

public CmdCancel(id)
{
if(!g_bHookSay[id])
return PLUGIN_HANDLED;

g_bHookSay[id] = false;
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_CANCEL");
return PLUGIN_HANDLED;
}

public CmdMessagesBlock(id)
{
if(~get_user_flags(id) & read_flags(g_sAccess))
return PLUGIN_HANDLED;

g_bChatBlocked = !g_bChatBlocked;
client_print_color(0, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_BLOCKED_ADMIN", id, LANG_SERVER, g_bChatBlocked ? "PM_BLOCKED_FOR" : "PM_BLOCKED_COUNT");
return PLUGIN_CONTINUE;
}

public CmdMain(id)
{
new menu = menu_create(fmt("%L", LANG_SERVER, "PM_TITLE_MESSAGES"), "MainHandler");

menu_additem(menu, fmt("%L", LANG_SERVER, "PM_WRITE"));
menu_additem(menu, fmt("%L", LANG_SERVER, "PM_BLOCK"));

menu_addtext2(menu, ArraySize(g_aIndex[id]) ? fmt("%L", LANG_SERVER, "PM_RECIPIENT") : fmt("%L", LANG_SERVER, "PM_RECIPIENT_NONE"));

if(ArraySize(g_aIndex[id]))
{
new save_index[MAX_PLAYERS + 1][MAX_PLAYERS + 1];
new szPlayer[10];
for(new i = 0; i < ArraySize(g_aIndex[id]); i++)
{
new get = ArrayGetCell(g_aIndex[id], i);
if(save_index[id][get] == get || !is_user_connected(get))
continue;

num_to_str(get, szPlayer, charsmax(szPlayer));
menu_additem(menu, fmt("%n", get), szPlayer);
save_index[id][get] = get;
}
}

menu_setprop(menu, MPROP_NEXTNAME, fmt("%L", LANG_SERVER, "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%L", LANG_SERVER, "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%L", LANG_SERVER, "PM_EXIT"));
menu_setprop(menu, MPROP_NUMBER_COLOR, "\y");

menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}

public MainHandler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}

if(g_bChatBlocked)
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_BLOCKED");
return PLUGIN_HANDLED;
}

new s_Data[6], s_Name[64], i_Access, i_Callback;
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback);
new tempid = str_to_num(s_Data);
new iPlayer = g_iPlayer[id] = tempid;

switch(item)
{
case 0:
CmdSend(id);
case 1:
CmdBlock(id);
case 2:
{
g_bType[id] = !g_bType[id];
CmdMain(id);
}
default:
{
if(!ArraySize(g_aIndex[id]))
return PLUGIN_HANDLED;

if(g_fChattingDelay[id] > get_gametime())
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_FLOOD");
return PLUGIN_HANDLED;
}

if(g_bPlayerBlocked[iPlayer][id])
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_PLAYER_BLOCKED", iPlayer);
return PLUGIN_HANDLED;
}
g_bHookSay[id] = true;
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_OPEN_CHAT");
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}

CmdSend(id, page = 0)
{
new iPlayers[MAX_PLAYERS], iNum, szPlayer[10], iPlayer;
get_players(iPlayers, iNum, "ch");

new menu = menu_create(fmt("%L", LANG_SERVER, "PM_TITLE_WRITE"), "SendHandler");

for (new i; i < iNum; i++)
{
iPlayer = iPlayers[i];

if(id == iPlayer)
continue;

num_to_str(iPlayer, szPlayer, charsmax(szPlayer));

switch(g_iType)
{
case 1: menu_additem(menu, fmt("%n", iPlayer), szPlayer);
case 2:
{
if(is_user_alive(id) == is_user_alive(iPlayer))
menu_additem(menu, fmt("%n", iPlayer), szPlayer);
}
case 3:
{
if(get_user_team(id) == get_user_team(iPlayer))
menu_additem(menu, fmt("%n", iPlayer), szPlayer);
}
}
}

menu_setprop(menu, MPROP_NEXTNAME, fmt("%L", LANG_SERVER, "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%L", LANG_SERVER, "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%L", LANG_SERVER, "PM_EXIT"));
menu_setprop(menu, MPROP_NUMBER_COLOR, "\y");

menu_display(id, menu, page);
return PLUGIN_CONTINUE;
}

public SendHandler(id, menu, item)
{
if(item == MENU_EXIT)
{
CmdMain(id);
return PLUGIN_HANDLED;
}

new s_Data[6], s_Name[64], i_Access, i_Callback;
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback);

new tempid = str_to_num(s_Data);
new iPlayer = g_iPlayer[id] = tempid;

if(g_fChattingDelay[id] > get_gametime())
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_FLOOD");
return PLUGIN_HANDLED;
}

if(g_bPlayerBlocked[iPlayer][id])
{
client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_PLAYER_BLOCKED", iPlayer);
return PLUGIN_HANDLED;
}

client_print_color(id, print_team_default, "%s %L", PREFIX, LANG_SERVER, "PM_OPEN_CHAT");
g_bHookSay[id] = true;

ArrayPushCell(g_aIndex[id], iPlayer);
if(ArraySize(g_aIndex[id]) > 3)
{
ArrayDeleteItem(g_aIndex[id], 0);
}
CmdSend(id, item / 7);

menu_destroy(menu);
return PLUGIN_HANDLED;
}

CmdBlock(id, page = 0)
{
new iPlayers[MAX_PLAYERS], iNum, szPlayer[10], iPlayer;
get_players(iPlayers, iNum, "ch");

new menu = menu_create(fmt("%L", LANG_SERVER, "PM_TITLE_BLOCK"), "BlockHandler");

for(new i; i < iNum; i++)
{
iPlayer = iPlayers[i];

if(id == iPlayer)
continue;

num_to_str(iPlayer, szPlayer, charsmax(szPlayer));

if(g_bPlayerBlocked[id][iPlayer])
menu_additem(menu, fmt("%n %L", iPlayer, LANG_SERVER, "PM_MENU_BLOCKED"), szPlayer);
else
menu_additem(menu, fmt("%n", iPlayer), szPlayer);
}

menu_setprop(menu, MPROP_NEXTNAME, fmt("%L", LANG_SERVER, "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%L", LANG_SERVER, "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%L", LANG_SERVER, "PM_EXIT"));
menu_setprop(menu, MPROP_NUMBER_COLOR, "\y");

menu_display(id, menu, page);
return PLUGIN_CONTINUE;
}

public BlockHandler(id, menu, item)
{
if(item == MENU_EXIT)
{
CmdMain(id);
return PLUGIN_HANDLED;
}

new s_Data[6], s_Name[64], i_Access, i_Callback;
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback);

new tempid = str_to_num(s_Data);
new iPlayer = g_iPlayer[id] = tempid;

g_bPlayerBlocked[id][iPlayer] = !g_bPlayerBlocked[id][iPlayer];
CmdBlock(id, item / 7);

menu_destroy(menu);
return PLUGIN_HANDLED;
}

// mx?!
stock register_saycmd(const szSayCmd[], szFunc[])
{
new const szPrefix[][] = { "say /", "say_team /", "say .", "say_team ." };
for(new i; i < sizeof(szPrefix); i++)
register_clcmd(fmt("%s%s", szPrefix[i], szSayCmd), szFunc);
}

stock replace_wrong_simbols(string[])
{
new len = 0;
for(new i; string[i] != EOS; i++)
{
if(string[i] == '%' || string[i] == '#' || 0x01 <= string[i] <= 0x04)
continue;
string[len++] = string[i];
}
string[len] = EOS;
}
.
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Попробуйте так:

Код:
public CmdMain(id)
{
+    if(!is_user_connected(id))
+        return PLUGIN_HANDLED;

    new menu = menu_create(fmt("%L", LANG_SERVER, "PM_TITLE_MESSAGES"), "MainHandler");

    menu_additem(menu, fmt("%L", LANG_SERVER, "PM_WRITE"));
    menu_additem(menu, fmt("%L", LANG_SERVER, "PM_BLOCK"));

    menu_addtext2(menu, ArraySize(g_aIndex[id]) ? fmt("%L", LANG_SERVER, "PM_RECIPIENT") : fmt("%L", LANG_SERVER, "PM_RECIPIENT_NONE"));

    if(ArraySize(g_aIndex[id]))
    {
 

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

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