Private message plugin error

Сообщения
290
Реакции
28
Помог
2 раз(а)
Ошибка
L 02/03/2020 - 16:47:16: Start of error session.
L 02/03/2020 - 16:47:16: Info (map "de_inferno") (file "addons/amxmodx/logs/error_20200203.log")
L 02/03/2020 - 16:47:16: String formatted incorrectly - parameter 6 (total 5)
L 02/03/2020 - 16:47:16: [AMXX] Displaying debug trace (plugin "private_message_core.amxx", version "1.5")
L 02/03/2020 - 16:47:16: [AMXX] Run time error 25: parameter error
L 02/03/2020 - 16:47:16: [AMXX] [0] private_message_core.sma::SendMessage (line 172)
L 02/03/2020 - 16:47:16: [AMXX] [1] private_message_core.sma::CmdPm (line 208)
ОС
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.693-dev
Build date: 18:20:58 Jan 28 2020 (2117)
Build from: https://github.com/dreamstalker/rehlds/commit/c4cecf5
ReGamedll
ReGameDLL version: 5.13.0.447-dev+m
Build date: 18:11:04 Jan 15 2020
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/2eba3b1
Версия 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.135 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] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[16] FakeMeta RUN - fakemeta_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] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[19] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[20] Fun RUN - fun_amxx_i386.so v1.9.0.5263 pl5 ANY ANY
[21] gRIP RUN - grip_amxx_i386.so v0.1.5 Beta pl5 ANY ANY
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] Lite Bans 2.2 neygomon lite_bans_off.a running
[ 2] ScreenMaker 1.1 neygomon screen_maker.am running
[ 3] [ReAPI] Anti overflow 1.0 Some Author antioverflow.am running
[ 4] Damager 0.0.6 steelzzz damager.amxx running
[ 5] Advanced Mute 2.1 OciXCrom crx_advmute.amx running
[ 6] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 7] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 8] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 9] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 10] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 11] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 12] AES Bonus: Flags 0.2 Sonyx aes_bonus_flags running
[ 13] Top Awards 1.0 neygomon top_awards.amxx running
[ 14] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 15] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 16] Admin Load 3.9.3 Dev F@nt0M adminload.amxx running
[ 17] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 18] Lista admini (amx_who) cs.area-ga Kobra whobun.amxx running
[ 19] unknown unknown unknown flash.amxx running
[ 20] Team Transfer 2.1 UnFoRgIvEn transfer_chat.a running
[ 21] MOTD Commands 1.3 OciXCrom crx_motdcommand running
[ 22] Motd System 1.0 Hypa_[KZ] motd_system.amx running
[ 23] Admin Commands 1.9.0.5241 AMXX Dev Team admincmd.amxx running
[ 24] Commands Menu 1.10.0.537 AMXX Dev Team cmdmenu.amxx running
[ 25] Menus Front-End 1.10.0.537 AMXX Dev Team menufront.amxx running
[ 26] SHOW IP + LAST IP 2.0 Alka + x amx_showip_last running
[ 27] Players Menu 1.7 neugomon players_menu.am running
[ 28] Pause Plugins 1.10.0.537 AMXX Dev Team pausecfg.amxx running
[ 29] Admin Help 1.9.0.5241 SPiNX adminhelp.amxx running
[ 30] Language Menu 1.0 F@nt0M langmenu.amxx running
[ 31] Plugin Menu 1.10.0.537 AMXX Dev Team pluginmenu.amxx running
[ 32] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running
[ 33] Private Message: Core 1.5 Denzer private_message debug
[ 34] Private Message: Loggi 1.3 Denzer private_message running
[ 35] Items Restrict 1.1 s1lent items_restrict. running
[ 36] Best Player MOTD 1.2.1 OciXCrom crx_bestplayer. running
[ 37] Simple Menu 2.1.1 OciXCrom crx_simplemenu. debug
[ 38] Restricted Names 1.1 Hattrick JM3Ch3R nick.amxx running
[ 39] Whatsapp_Group_Request 3.2 CrAzY MaN whatsapp_group_ running
[ 40] Quick and No Scope Det 1.2 EFFx QuickNoScopeD.a running
[ 41] [ReAPI] AdminFreeLook 1.0 ReHLDS Team adminfreelook.a running
[ 42] SERVER TASKS 2.0 HATTRICK (HTTRCK server_tasks.am running
[ 43] Bet 2.2 Filip Vilicic bet.amxx running
[ 44] Stats Configuration 1.10.0.537 AMXX Dev Team statscfg.amxx running
[ 45] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 46] Style C4 Timer 3.0 OciXCrom crx_c4timer.amx running
[ 47] Ping Faker 1.5a MeRcyLeZZ pingfaker_count running
[ 48] unknown unknown unknown fake.amxx running
[ 49] Ultimele Harti 1.0 M@$t3r_@dy harti.amxx running
[ 50] CFG Slash 1.0 aNNakin cfg_slash.amxx running
[ 51] [ReAPI] TopRoundDamage 1.0.5 Dager* *.* -G- damage_round.am running
[ 52] Fall Damage HP Restore 0.0.1 Vaqtincha FallDamageHpRes running
[ 53] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 54] Objective as GameName 1.1.1 CHEL74 obj_as_gamename running
[ 55] Activitate Admini 2.0c Askhanar activitate.amxx running
[ 56] ResetScore 1.0 Leo_[BH] resetscore_reap running
[ 57] Reklama 09.07.2019 mx?! reklama.amxx running
[ 58] [SQL] Chat Manager 1.1.1-13 Mistrick chatmask.amxx running
[ 59] Auto Round Restart 1.0 LondoN eXtream restartr.amxx running
[ 60] Simple Online Logger 23.05.19 mx?! simple_online_l running
[ 61] Trial Access 1.0.0 mx?! trial_access.am running
[ 62] Slap/Slay Team 1.0 Kobra slaylslapteam.a running
[ 63] VIP Menu [CS.AREA-GAME 0.15 Leo_[BH](tradus vip_reapi.amxx debug
[ 64] VIP NOU 1.0 test vampire.amxx running
[ 65] Invisible Spectator 1.0 ReHLDS Team invisible_spect running
[ 66] Check Vip 2.0 Leo_[BH] check.amxx running
[ 67] Slay Losers 1.1.6 [email protected] slay_losers.amx running
[ 68] Map Manager: Core 3.0.0 Mistrick map_manager_cor running
[ 69] Map Manager: Scheduler 0.1.0 Mistrick map_manager_sch running
[ 70] Map Manager: Rtv 0.0.4 Mistrick map_manager_rtv paused
[ 71] Map Manager: Nominatio 0.0.8 Mistrick map_manager_nom running
[ 72] Map Manager: BlockList 0.0.3 Mistrick map_manager_blo running
[ 73] Map Manager: Online so 0.0.2 Mistrick map_manager_onl running
[ 74] Map Manager: Effects 0.0.8 Mistrick map_manager_eff running
[ 75] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 76] Map Manager: Advanced 0.0.4 Mistrick map_manager_adv running
[ 77] FocusOnVotemap 1.2.1 Boec[SpecOPs] focus_on_votema running
[ 78] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 79] Team Select 1.5.0 F@nt0M teamselect.amxx running
[ 80] Force Gag 1.2 zorken zilla_gag.amxx running
[ 81] ReParachute 1.1 PurposeLess reparachute.amx running
[ 82] [ReAPI:AMXX] Buy Nades 0.2 F@nt0M Buy_Nades_Timeo debug
[ 83] Voiceserver Connect 1.1.015 Nextra voiceserver_con debug
[ 84] Hide 1.1 xPaw hidexpaw.amxx running
[ 85] M_AntiRusher 2.83 Miczu xPaw_Antirusher running
[ 86] Advanced Eliminate 0.1.5 Askhanar advanced_elimin running
[ 87] Admin Exec 2.0c Askhanar amx_exec.amxx running
[ 88] Say Me And HP 1.0 Javekson say_me_hp.amxx running
[ 89] Save score & money 1.2.4 Minni Mouse Save_Score_and_ running
[ 90] Boost Server Payment 1.0 JazZ. boostsv.amxx running
[ 91] Hostname Timeleft 1.0 xPaw HostnameTimelef running
[ 92] [ReAPI] Block Fire in 3.1.0 F@nt0M reapi_block_fit running
[ 93] Admins Only 1.0 Andy staffonly.amxx running
[ 94] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 95] Mode 2x2 2.5re s1lent mode.amxx running
95 plugins, 94 running
Автор плагина
Denzer
Версия плагина
1.5
Исходный код
#include <amxmodx>

#pragma semicolon 1

#define PLUGIN_NAME "Private Message: Core"
#define PLUGIN_VERSION "1.5"
#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_STOP, FP_CELL, FP_CELL, FP_STRING);
g_hForwards[PLAYER_BLOCKED] = CreateMultiForward("pm_player_blocked", ET_STOP, 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_putinserver(id)
{
for(new i = 1; i <= MaxClients; i++)
{
g_bPlayerBlocked[id][i] = false;
g_bPlayerBlocked[i][id] = false;
}
g_ePlayerData[id][TARGET] = 0;
g_ePlayerData[id][DELAY] = 0.0;
}

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 found = ArrayFindValue(g_ePlayerData[iSender][RECEIVER], iReceiver);

if(found != -1)
ArrayDeleteItem(g_ePlayerData[iSender][RECEIVER], found);

ArrayPushCell(g_ePlayerData[iSender][RECEIVER], iReceiver);

if(ArraySize(g_ePlayerData[iSender][RECEIVER]) > 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;

if(!g_ePlayerData[id][RECEIVER])
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 iPlayer = ArrayGetCell(g_ePlayerData[id][RECEIVER], i);
if(!is_user_connected(iPlayer))
continue;

num_to_str(iPlayer, szPlayer, charsmax(szPlayer));
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, 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 iPlayer = g_ePlayerData[id][TARGET] = str_to_num(s_Data);

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^"");
CmdMain(id);
}
}
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;
}
Casually this error is popping
 
Сообщения
1,701
Реакции
1,512
Помог
26 раз(а)
Give the lang file.
 
Сообщения
271
Реакции
348
Помог
15 раз(а)
Код:
[en]
PM_PLAYER_BLOCKED = Communication between you and this player has been blocked

[ro]
PM_PLAYER_BLOCKED = Jucatorul %n te-a blocat
???
 

wellasgood

Кидала, мошенник, вымогатель
Сообщения
1,409
Реакции
182
Помог
2 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
А чо так можно было?
"%l %l"
5 Фев 2020
:derisive:
 

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

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