Private message plugin error

Сообщения
290
Реакции
28
Помог
2 раз(а)
Ошибка
L 11/22/2019 - 22:23:43: String formatted incorrectly - parameter 6 (total 5)
L 11/22/2019 - 22:23:43: [AMXX] Displaying debug trace (plugin "private_message_core.amxx", version "1.4")
L 11/22/2019 - 22:23:43: [AMXX] Run time error 25: parameter error
L 11/22/2019 - 22:23:43: [AMXX] [0] private_message_core.sma::SendMessage (line 161)
L 11/22/2019 - 22:23:43: [AMXX] [1] private_message_core.sma::CmdPm (line 199)
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5263 (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: Oct 27 2019 16:23:31
Built from: https://github.com/alliedmodders/amxmodx/commit/15a14a0
Build ID: 5263:15a14a0
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.7.0.692-dev
Build date: 18:58:01 Sep 21 2019 (1988)
Build from: https://github.com/dreamstalker/rehlds/commit/e7232be
ReGamedll
ReGameDLL version: 5.12.0.425-dev
Build date: 08:48:23 Nov 2 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/fd06d65
Версия 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
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] SafeNameAndChat RUN - SafeNameAndChat.so v1.1 ini ANY ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.92c ini Start Never
[ 3] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 4] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5263 ini Start ANY
[ 6] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 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] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.11.0.190-dev pl5 ANY Never
[11] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl5 ANY ANY
[12] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[13] Hide Cvars RUN - hidecvars_amxx_i386.so v1.0 pl5 ANY ANY
[14] AuthEmu RUN - authemu_amxx_i386.so v4.2.12.265-dev+m pl5 ANY Never
[15] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[17] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[18] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[19] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[20] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[21] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[22] gRIP RUN - grip_amxx_i386.so v0.1.5 Beta pl5 ANY ANY
22 plugins, 22 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Discord Chat Relay 1.0 endnch AMXX-Server-Rel running
[ 2] fb_forwards 0.1.4 Kanagava & Realu fb_forwards.amx running
[ 3] FreshBans 1.4.3b kanagava fresh_bans_143_ running
[ 4] [ReAPI] Anti overflow 1.0 Some Author antioverflow.am running
[ 5] Damager 0.0.6 steelzzz damager.amxx running
[ 6] Advanced Mute 2.1 OciXCrom crx_advmute.amx running
[ 7] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 8] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 9] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 10] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 11] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 12] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 13] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 14] Top Awards 1.0 neygomon top_awards.amxx running
[ 15] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 16] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 17] Admin Load 3.9.3 Dev F@nt0M adminload.amxx running
[ 18] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 19] Lista admini (amx_who) cs.area-ga Kobra whobun.amxx running
[ 20] Accuracy Fix 3.0 Numb accuracy_fix.am running
[ 21] unknown unknown unknown flash.amxx running
[ 22] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 23] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 24] Motd System 1.0 Hypa_[KZ] motd_system.amx running
[ 25] Admin Commands 1.9.0.5241 AMXX Dev Team admincmd.amxx running
[ 26] Commands Menu 1.10.0.537 AMXX Dev Team cmdmenu.amxx running
[ 27] Menus Front-End 1.10.0.537 AMXX Dev Team menufront.amxx running
[ 28] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 29] Players Menu 1.7 neugomon players_menu.am running
[ 30] Pause Plugins 1.10.0.537 AMXX Dev Team pausecfg.amxx running
[ 31] Admin Help 1.9.0.5241 SPiNX adminhelp.amxx running
[ 32] Language Menu 1.0 F@nt0M langmenu.amxx running
[ 33] Plugin Menu 1.10.0.537 AMXX Dev Team pluginmenu.amxx running
[ 34] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running
[ 35] Private Message: Core 1.4 Denzer private_message debug
[ 36] Private Message: Loggi 1.3 Denzer private_message running
[ 37] Items Restrict 1.1 s1lent items_restrict. running
[ 38] Best Player MOTD 1.2.1 OciXCrom crx_bestplayer. running
[ 39] Simple Menu 2.1.1 OciXCrom crx_simplemenu. debug
[ 40] Restricted Names 1.1 Hattrick JM3Ch3R nick.amxx running
[ 41] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 42] Quick and No Scope Det 1.2 EFFx QuickNoScopeD.a running
[ 43] Christmas hat 0.3 AMXX.Shop christmas_hat_r running
[ 44] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 45] Bet 2.2 Filip Vilicic bet.amxx running
[ 46] Team Grenade Trail 1.2 Numb team_grenade_tr running
[ 47] Stats Configuration 1.10.0.537 AMXX Dev Team statscfg.amxx running
[ 48] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 49] Style C4 Timer 3.0 OciXCrom crx_c4timer.amx running
[ 50] Ping Faker 1.5a MeRcyLeZZ pingfaker_count running
[ 51] unknown unknown unknown fake.amxx running
[ 52] Ultimele Harti 1.0 M@$t3r_@dy harti.amxx running
[ 53] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 54] [ReAPI] TopRoundDamage 1.0.5 Dager* *.* -G- damage_round.am running
[ 55] Fall Damage HP Restore 0.0.1 Vaqtincha FallDamageHpRes running
[ 56] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 57] Objective as GameName 1.1.1 CHEL74 obj_as_gamename running
[ 58] Activitate Admini 2.0c Askhanar activitate.amxx running
[ 59] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 60] Reklama 09.07.2019 mx?! reklama.amxx running
[ 61] [SQL] Chat Manager 1.1.1-13 Mistrick chatmask.amxx running
[ 62] Auto Round Restart 1.0 LondoN eXtream restartr.amxx running
[ 63] Simple Online Logger 23.05.19 mx?! simple_online_l running
[ 64] Trial Access 05.07.19 mx?! trial_access.am running
[ 65] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 66] VIP Menu [CS.AREA-GAME 0.15 Leo_[BH](tradus vip_reapi.amxx debug
[ 67] VIP NOU 1.0 test vampire.amxx running
[ 68] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 69] Check Vip 2.0 Leo_[BH] check.amxx running
[ 70] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[ 71] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 72] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 73] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv running
[ 74] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 75] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 76] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 77] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 78] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 79] Map Manager: Advanced 0.0.4 Mistrick map_manager_adv running
[ 80] FocusOnVotemap 1.2.1 Boec[SpecOPs] focus_on_votema running
[ 81] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 82] Team Select 1.5.0 F@nt0M teamselect.amxx running
[ 83] Force Gag 1.2 zorken zilla_gag.amxx running
[ 84] ReParachute 1.1 PurposeLess reparachute.amx running
[ 85] [ReAPI:AMXX] Buy Nades 0.2 F@nt0M Buy_Nades_Timeo debug
[ 86] Voiceserver Connect 1.1.015 Nextra voiceserver_con debug
[ 87] Advanced Kill Assists 0.9 Spection next21_kill_ass debug
[ 88] Hide 1.1 xPaw hidexpaw.amxx running
[ 89] M_AntiRusher 2.83 Miczu xPaw_Antirusher running
[ 90] Advanced Eliminate 0.1.5 Askhanar advanced_elimin running
[ 91] Admin Exec 2.0c Askhanar amx_exec.amxx running
[ 92] Say Me And HP 1.0 Javekson say_me_hp.amxx running
[ 93] Save score & money 1.2.4 Minni Mouse Save_Score_and_ running
[ 94] Night VIP 1.0 TBONTB vipfreenoaptea. running
[ 95] Boost Server Payment 1.0 JazZ. boostsv.amxx running
[ 96] Discord Reports 0.2 paffgame discord.amxx running
[ 97] Hostname Timeleft 1.0 xPaw HostnameTimelef running
[ 98] AuthEmu API 1.0 Dev-MS Team authemu.amxx running
[ 99] GSClient: Money Bonus 1.0.0 brody gsclient_money_ running
[100] New Plug-In 1.0 Author ninsoare.amxx running
100 plugins, 100 running
Автор плагина
Denzer
Версия плагина
1.4
Исходный код
#include <amxmodx>

#pragma semicolon 1

#define PLUGIN_NAME "Private Message: Core"
#define PLUGIN_VERSION "1.4"
#define PLUGIN_AUTHOR "Denzer"

enum _:CVARS
{
TYPE,
Float:COOLDOWN,
MAX_RECEIVER
};

enum _:FORWARDS
{
SENT,
PLAYER_BLOCKED,
};

enum _:DATA
{
TARGET,
Float:DELAY,
Array:RECEIVER
};

new g_Cvars[CVARS];
new g_hForwards[FORWARDS];
new g_ePlayerData[MAX_PLAYERS + 1][DATA];
new bool:g_bPlayerBlocked[MAX_PLAYERS + 1][MAX_PLAYERS + 1];
new bool:g_bChatBlocked;

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

new pCvar;
pCvar = create_cvar("pm_type", "1", FCVAR_NONE, "1 - 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_Cvars[TYPE]);

pCvar = create_cvar("pm_delay", "2.5", FCVAR_NONE, "Time between messages", true, 0.0, true, 10.0);
bind_pcvar_float(pCvar, g_Cvars[COOLDOWN]);

pCvar = create_cvar("pm_max_receiver", "3", FCVAR_NONE, "Maximum receivers (menu)", true, 0.0, true, 4.0);
bind_pcvar_num(pCvar, g_Cvars[MAX_RECEIVER]);

AutoExecConfig();

g_hForwards[SENT] = CreateMultiForward("pm_message_sent", ET_CONTINUE, FP_CELL, FP_CELL, FP_STRING);
g_hForwards[PLAYER_BLOCKED] = CreateMultiForward("pm_player_blocked", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL);

register_saycmd("pm", "CmdMain");
register_clcmd("pm", "CmdPm");

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

for(new i = 1; i <= MaxClients; i++)
g_ePlayerData[i][RECEIVER] = ArrayCreate();

register_dictionary("private_message.txt");
}

public plugin_end()
{
for(new i = 1; i <= MaxClients; i++)
ArrayDestroy(g_ePlayerData[i][RECEIVER]);
}

public plugin_natives()
{
register_native("pm_is_chat_blocked", "native_pm_is_chat_blocked");
register_native("pm_is_player_blocked", "native_pm_is_player_blocked");
register_native("pm_block_use", "native_pm_block_use");
register_native("pm_send_message", "native_pm_send_message");
}

#define IsPlayerValid(%0) (1 <= %0 <= MaxClients)

public native_pm_is_chat_blocked(plugin, params)
{
return bool:g_bChatBlocked;
}

public native_pm_is_player_blocked(plugin, params)
{
enum { blocker = 1, blocked };

new blocker_id = get_param(blocker), blocked_id = get_param(blocked);

if(!IsPlayerValid(blocker_id))
abort(AMX_ERR_NATIVE, "Player out of range (%d)", blocker_id);

if(!IsPlayerValid(blocked_id))
abort(AMX_ERR_NATIVE, "Player out of range (%d)", blocked_id);

return bool:g_bPlayerBlocked[blocker_id][blocked_id];
}

public native_pm_block_use(plugin, params)
{
enum { type = 1 };
g_bChatBlocked = bool:get_param(type);
}

public native_pm_send_message(plugin, params)
{
enum { sender = 1, recipient, array };

new sender_id = get_param(sender), recipient_id = get_param(recipient);

if(!IsPlayerValid(sender_id))
abort(AMX_ERR_NATIVE, "Player out of range (%d)", sender_id);

if(!IsPlayerValid(recipient_id))
abort(AMX_ERR_NATIVE, "Player out of range (%d)", recipient_id);

new message[140];
get_string(array, message, charsmax(message));

SendMessage(sender_id, recipient_id, message);
}

public client_disconnected(id)
{
new iPlayers[MAX_PLAYERS], iNum;
get_players(iPlayers, iNum, "ch");
for(new i; i < iNum; i++)
{
new iPlayer = iPlayers[i];
if(id == iPlayer)
continue;

if(!g_ePlayerData[iPlayer][RECEIVER])
continue;

new found = ArrayFindValue(g_ePlayerData[iPlayer][RECEIVER], id);
if(found != -1)
ArrayDeleteItem(g_ePlayerData[iPlayer][RECEIVER], found);
}
ArrayClear(g_ePlayerData[id][RECEIVER]);
}

public SendMessage(iSender, iReceiver, message[])
{
replace_wrong_simbols(message);

if(!message[0])
return;

new ret;
ExecuteForward(g_hForwards[SENT], ret, iSender, iReceiver, message);

if(ret >= PLUGIN_HANDLED)
return;

if(g_bPlayerBlocked[iSender][iReceiver] || g_bPlayerBlocked[iReceiver][iSender])
{
client_print_color(iSender, print_team_default, "%l %l", "PM_PREFIX", "PM_PLAYER_BLOCKED");
return;
}

if(g_ePlayerData[iSender][DELAY] > get_gametime())
{
client_print_color(iSender, print_team_default, "%l %l","PM_PREFIX", "PM_FLOOD");
return;
}

g_ePlayerData[iSender][DELAY] = get_gametime() + g_Cvars[COOLDOWN];
client_print_color(iSender, print_team_default, "%l", "PM_MESSAGE_TO", iReceiver, message);
client_print_color(iReceiver, print_team_default, "%l", "PM_MESSAGE_FROM", iSender, message);

new iSize = ArraySize(g_ePlayerData[iSender][RECEIVER]);
for(new i; i < iSize; i++)
{
new get = ArrayGetCell(g_ePlayerData[iSender][RECEIVER], i);
if(get == iReceiver)
ArrayDeleteItem(g_ePlayerData[iSender][RECEIVER], i);
}
ArrayPushCell(g_ePlayerData[iSender][RECEIVER], iReceiver);

if(iSize > g_Cvars[MAX_RECEIVER])
ArrayDeleteItem(g_ePlayerData[iSender][RECEIVER], 0);
}

public CmdPm(id)
{
new iPlayer = g_ePlayerData[id][TARGET];
if(!is_user_connected(iPlayer))
return;

new szArgs[140];
read_args(szArgs, charsmax(szArgs));
remove_quotes(szArgs);
trim(szArgs);

SendMessage(id, iPlayer, szArgs);
}

public CmdSay(id)
{
if(g_bChatBlocked)
return PLUGIN_CONTINUE;

new szArgs[140], szName[32], szSaveArgs[140];
read_argv(1, szArgs, charsmax(szArgs));
remove_quotes(szArgs);
trim(szArgs);
copy(szSaveArgs, charsmax(szSaveArgs), szArgs);
parse(szArgs,
szArgs, charsmax(szArgs),
szName, charsmax(szName));

if(equal(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;

new szReplace[64];
formatex(szReplace, charsmax(szReplace), "/pm %s ", szName);
replace(szSaveArgs, sizeof(szSaveArgs), szReplace, "");

SendMessage(id, found_id, szSaveArgs);
return PLUGIN_HANDLED;
}
else
{
CmdMain(id);
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}

public CmdMain(id)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;

SetGlobalTransTarget(id);
new menu = menu_create(fmt("%l", "PM_TITLE_MESSAGES"), "MainHandler");

menu_additem(menu, fmt("%l", "PM_WRITE"));
menu_additem(menu, fmt("%l", "PM_BLOCK"));

new iSize = ArraySize(g_ePlayerData[id][RECEIVER]);
menu_addtext2(menu, iSize ? fmt("%l", "PM_RECIPIENT") : fmt("%l","PM_RECIPIENT_NONE"));

if(iSize)
{
new szPlayer[10];
for(new i; i < iSize; i++)
{
new get = ArrayGetCell(g_ePlayerData[id][RECEIVER], i);
if(!is_user_connected(get))
continue;

num_to_str(get, szPlayer, charsmax(szPlayer));
menu_additem(menu, fmt("%n", get), szPlayer);
}
}

menu_setprop(menu, MPROP_NEXTNAME, fmt("%l", "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%l", "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%l", "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, "%l %l", "PM_PREFIX", "PM_BLOCKED");
menu_destroy(menu);
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);
menu_destroy(menu);
new tempid = str_to_num(s_Data);
new iPlayer = g_ePlayerData[id][TARGET] = tempid;

switch(item)
{
case 0:
MenuSend(id);
case 1:
MenuBlock(id);
default:
{
if(!ArraySize(g_ePlayerData[id][RECEIVER]))
return PLUGIN_HANDLED;

if(!is_user_connected(iPlayer))
return PLUGIN_HANDLED;

client_cmd(id, "messagemode ^"pm^"");
}
}
return PLUGIN_HANDLED;
}

MenuSend(id, page = 0)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;

SetGlobalTransTarget(id);
new iPlayers[MAX_PLAYERS], iNum, szPlayer[10], iPlayer;
get_players(iPlayers, iNum, "ch");

new menu = menu_create(fmt("%l", "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_Cvars[TYPE])
{
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", "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%l", "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%l", "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);
menu_destroy(menu);
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);
menu_destroy(menu);

new tempid = str_to_num(s_Data);
g_ePlayerData[id][TARGET] = tempid;

if(g_bChatBlocked)
{
client_print_color(id, print_team_default, "%l %l", "PM_PREFIX", "PM_BLOCKED");
return PLUGIN_HANDLED;
}

client_cmd(id, "messagemode ^"pm^"");
MenuSend(id, item / 7);
return PLUGIN_HANDLED;
}

MenuBlock(id, page = 0)
{
if(!is_user_connected(id))
return PLUGIN_HANDLED;

SetGlobalTransTarget(id);
new iPlayers[MAX_PLAYERS], iNum, szPlayer[10], iPlayer;
get_players(iPlayers, iNum, "ch");

new menu = menu_create(fmt("%l", "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, "PM_MENU_BLOCKED"), szPlayer);
else
menu_additem(menu, fmt("%n", iPlayer), szPlayer);
}

menu_setprop(menu, MPROP_NEXTNAME, fmt("%l", "PM_NEXT"));
menu_setprop(menu, MPROP_BACKNAME, fmt("%l", "PM_BACK"));
menu_setprop(menu, MPROP_EXITNAME, fmt("%l", "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);
menu_destroy(menu);
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);
menu_destroy(menu);

new tempid = str_to_num(s_Data);
new iPlayer = tempid;

new ret;
ExecuteForward(g_hForwards[PLAYER_BLOCKED], ret, id, iPlayer, g_bPlayerBlocked[id][iPlayer]);

if(ret >= PLUGIN_HANDLED)
return PLUGIN_HANDLED;

g_bPlayerBlocked[id][iPlayer] = !g_bPlayerBlocked[id][iPlayer];
MenuBlock(id, item / 7);
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;
}
.
 
В этой теме было размещено решение! Перейти к решению.

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

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