Участник
Пользователь
- Сообщения
- 272
- Реакции
- 14
Hi.
I have a menu for kicking players from the server. You can kick a player for a specific reason.
The problem is that the information in the console after the ban is displayed every 'enter', example:
[Fk] ----------------- [Fk]
text1
text2
text3
[Fk] ----------------- [Fk]
and I would like it to display by default:
[Fk] ----------------- [Fk]
text1
text2
text3
[Fk] ----------------- [Fk]
Can anyone help?
I have a menu for kicking players from the server. You can kick a player for a specific reason.
The problem is that the information in the console after the ban is displayed every 'enter', example:
[Fk] ----------------- [Fk]
text1
text2
text3
[Fk] ----------------- [Fk]
and I would like it to display by default:
[Fk] ----------------- [Fk]
text1
text2
text3
[Fk] ----------------- [Fk]
Can anyone help?
Код:
#include <amxmodx>
#define MAX_POWODOW 20
new g_kogo[33];
new last[33][128];
new Array: powody;
public plugin_cfg() {
powody = ArrayCreate(256, 1);
new plik[128]; get_localinfo("amxx_configsdir", plik, charsmax(plik));
format(plik, charsmax(plik), "%s/powody_kickow.ini", plik);
if(!file_exists(plik))
set_fail_state("Brak pliku z powodami.");
new fp = fopen(plik, "r");
new i = 0, tresc[128];
while(!feof(fp) && i < MAX_POWODOW) {
fgets(fp, tresc, charsmax(tresc)); trim(tresc);
if(tresc[0] == ';' || tresc[0] == '^0') continue;
ArrayPushString(powody, tresc);
i++;
}
fclose(fp);
}
public plugin_init() {
register_plugin("Reason Kicker", "2.0", "Lazorux");
register_clcmd("amx_kickmenu", "cmdKickMenu");
register_clcmd("amx_custom", "cmdWlasnyPowod");
}
public cmdKickMenu(id) {
if(get_user_flags(id) & ADMIN_KICK) {
MenuKickow(id);
}
return PLUGIN_HANDLED;
}
3, callback);
new pl = str_to_num(data);
if(get_user_flags(pl) & ADMIN_IMMUNITY || pl == id)
return ITEM_DISABLED;
return ITEM_ENABLED;
}
public MenuPowodow(id) {
new m = menu_create("\rWybierz powod", "MenuPowodow_");
new p[128];
for(new i = 0; i < ArraySize(powody); i++) {
ArrayGetString(powody, i, p, charsmax(p));
menu_additem(m, p);
}
menu_addblank(m, 0);
menu_additem(m, "\yWlasny powod");
{
if(!g_kogo[id]) {
//client_print(id, print_chat, "%s Nie ma wszystkich danych");
return;
}
new pl = g_kogo[id];
new name[2][33];
//get_user_name(id, name[0], 32);
get_user_name(pl, name[1], 32);
set_hudmessage(100, 45, 20, 0.8, 0.5, 0, 5.0, 10.0, 1.0, 1.0, -1);
show_hudmessage(0, "Rk: Admin kicked player %s! Reason: %s", name[1], powod);
client_print_color(0, print_team_default, "Rk: Admin kicked player %s! Reason: %s", name[1], powod);
console_print(pl, "[RK] --------------------------- ------------------------ [RK]");
console_print(pl, "| You have been kicked by admin!");
console_print(pl, "| Reason: %s", powod);
console_print(pl, "| Think you were not properly kicked? Please contact the administration!");
console_print(pl, "| Contact: ......");
console_print(pl, "[RK] --------------------------- ------------------------ [RK]");
server_cmd("kick #%d %s", get_user_userid(pl), powod);
}
Последнее редактирование: