вот исходник и т.д! как мне поставить к примеру свои выборы, меню ножей, Админы онлайн и т.д? не получается и всё, ошибку выдаёт
- Код: Выделить всё
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#pragma semicolon 1
#define PLUGIN_NAME "[TUT] Server Menu"
#define PLUGIN_VERS "1.0"
#define PLUGIN_AUTH "NIXON"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERS, PLUGIN_AUTH);
register_message(get_user_msgid("ShowMenu"), "MessageShowMenu");
register_message(get_user_msgid("VGUIMenu"), "MessageVGUIMenu");
register_menu("JoinMenu", 563, "handled_JoinMenu");
register_menu("MainMenu", 531, "handled_MainMenu");
}
public MessageShowMenu(iMsgID, iDest, id)
{
if (!is_user_connected(id)) return PLUGIN_HANDLED;
static iMenuCode[21];
get_msg_arg_string(4, iMenuCode, charsmax(iMenuCode));
switch (iMenuCode[1]) {
case 'T': {
set_pdata_int(id, 205, 0);
return ClCmd_JoinMenu(id);
}
case 'I': {
set_pdata_int(id, 205, 0);
if (cs_get_user_team(id) == CS_TEAM_UNASSIGNED || cs_get_user_team(id) == CS_TEAM_SPECTATOR) return ClCmd_JoinMenu(id);
else return ClCmd_MainMenu(id);
}
}
return PLUGIN_HANDLED;
}
public MessageVGUIMenu(iMsgID, iDest, id)
{
if (!is_user_connected(id)) return PLUGIN_HANDLED;
switch(get_msg_arg_int(1)) {
case 2: {
if (cs_get_user_team(id) == CS_TEAM_UNASSIGNED || cs_get_user_team(id) == CS_TEAM_SPECTATOR) return ClCmd_JoinMenu(id);
else return ClCmd_MainMenu(id);
}
default: return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public ClCmd_JoinMenu(id)
{
new iMenu[256], iLen;
new iKeysMenu = MENU_KEY_5|MENU_KEY_0;
iLen = formatex(iMenu, charsmax(iMenu), "\rВыберите команду:^n^n");
if (cs_get_user_team(id) == CS_TEAM_T) iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\d1. Террорист [%d]^n", fnGetPlayerTeam(CS_TEAM_T));
else {
iKeysMenu |= MENU_KEY_1;
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y1. \wТеррорист \d[%d]^n", fnGetPlayerTeam(CS_TEAM_T));
}
if (cs_get_user_team(id) == CS_TEAM_CT) iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\d2. Контр-Террорист [%d]^n^n", fnGetPlayerTeam(CS_TEAM_CT));
else {
iKeysMenu |= MENU_KEY_2;
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y2. \wКонтр-Террорист \d[%d]^n^n", fnGetPlayerTeam(CS_TEAM_CT));
}
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y5. \wАвто-Выбор^n");
if (cs_get_user_team(id) == CS_TEAM_SPECTATOR) iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\d6. Спектатор^n^n");
else {
iKeysMenu |= MENU_KEY_6;
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y6. \wСпектатор^n^n");
}
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y0. \wВыход");
show_menu(id, iKeysMenu, iMenu, -1, "JoinMenu");
return PLUGIN_HANDLED;
}
public handled_JoinMenu(id, iKeys)
{
static iRestore, iVGUI, iMsgBlock;
iRestore = get_pdata_int(id, 510);
iVGUI = iRestore & (1<<0);
if (iVGUI) set_pdata_int(id, 510, iRestore & ~(1<<0));
switch (iKeys) {
case 0, 1, 4: {
if (iKeys <= 1 && (cs_get_user_team(id) == CS_TEAM_T || cs_get_user_team(id) == CS_TEAM_CT)) return PLUGIN_HANDLED;
iMsgBlock = get_msg_block(get_user_msgid("ShowMenu"));
set_msg_block(get_user_msgid("ShowMenu"), BLOCK_ONCE);
engclient_cmd(id, "jointeam", (iKeys == 4 ? "5" : (iKeys == 0 ? "1" : "2")));
engclient_cmd(id, "joinclass", "5");
set_msg_block(get_user_msgid("ShowMenu"), iMsgBlock);
}
case 5: {
if (cs_get_user_team(id) == CS_TEAM_SPECTATOR) return PLUGIN_HANDLED;
iMsgBlock = get_msg_block(get_user_msgid("ShowMenu"));
set_msg_block(get_user_msgid("ShowMenu"), BLOCK_ONCE);
dllfunc(DLLFunc_ClientPutInServer, id);
set_msg_block(get_user_msgid("ShowMenu"), iMsgBlock);
set_pdata_int(id, 349, 1);
engclient_cmd(id, "jointeam", "6");
}
}
if (iVGUI) set_pdata_int(id, 510, iRestore);
set_pdata_int(id, 125, get_pdata_int(id, 125, 5) & ~(1<<8), 5);
return PLUGIN_HANDLED;
}
public ClCmd_MainMenu(id)
{
new iMenu[256], iLen;
static iKeysMenu = MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_0;
iLen = formatex(iMenu, charsmax(iMenu), "\rИгровое меню:^n^n");
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y1. \wОбнулить счёт^n");
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y2. \wКупить \rадминку^n^n");
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y5. \wВыбор команды^n^n");
iLen += formatex(iMenu[iLen], charsmax(iMenu) - iLen, "\y0. \wВыход");
show_menu(id, iKeysMenu, iMenu, -1, "MainMenu");
return PLUGIN_HANDLED;
}
public handled_MainMenu(id, iKeys)
{
switch (iKeys) {
case 0: client_print(id, print_chat, "Вы обнулили счёт");
case 1: client_print(id, print_chat, "Админка");
case 4: return ClCmd_JoinMenu(id);
}
return PLUGIN_HANDLED;
}
stock fnGetPlayerTeam(CsTeams: iTeam)
{
static iPlayers[32], iNum;
get_players(iPlayers, iNum, "e", (iTeam == CS_TEAM_T ? "TERRORIST" : "CT"));
return iNum;
}
Неинформативное название темы (исправлено) // Subb98