Не компилируется teamselect.sma Помогите.

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
4
Реакции
-2
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Ошибка
AMX Mod X Compiler 1.8.3-dev+5147
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

teamselect.sma(33) : error 017: undefined symbol "MAX_PLAYERS"
teamselect.sma(35) : error 009: invalid array size (negative or zero)
teamselect.sma(46) : error 017: undefined symbol "create_cvar"
teamselect.sma(47) : error 017: undefined symbol "bind_pcvar_num"
teamselect.sma(49) : error 017: undefined symbol "create_cvar"
teamselect.sma(50) : error 017: undefined symbol "bind_pcvar_num"
teamselect.sma(52) : error 017: undefined symbol "create_cvar"
teamselect.sma(53) : error 017: undefined symbol "bind_pcvar_num"
teamselect.sma(55) : error 017: undefined symbol "create_cvar"
teamselect.sma(56) : error 017: undefined symbol "bind_pcvar_num"
teamselect.sma(58) : error 017: undefined symbol "create_cvar"
teamselect.sma(59) : error 017: undefined symbol "bind_pcvar_float"
teamselect.sma(61) : error 017: undefined symbol "create_cvar"
teamselect.sma(62) : error 017: undefined symbol "bind_pcvar_num"
teamselect.sma(64) : error 017: undefined symbol "create_cvar"
teamselect.sma(65) : error 017: undefined symbol "hook_cvar_change"
teamselect.sma(67) : error 017: undefined symbol "create_cvar"
teamselect.sma(68) : error 017: undefined symbol "hook_cvar_change"
teamselect.sma(88) : error 017: undefined symbol "client_printex"
teamselect.sma(93) : error 017: undefined symbol "SetGlobalTransTarget"
teamselect.sma(95) : error 017: undefined symbol "MAX_MENU_LENGTH"
teamselect.sma(95) : error 029: invalid expression, assumed zero
teamselect.sma(95) : error 017: undefined symbol "keys"
teamselect.sma(95) : fatal error 107: too many error messages on one line

Compilation aborted.
24 Errors.
Done.
Компилятор
WEB-компилятор
Amx Mod X
1.9.0
Исходный код
/**
*
* Name: Team Menu
* Version: 1.5.0 (04.02.2019)
* Author: F@nt0M
* Description: The plugin show custom team select menu instead of default
*
* Requirements: ReHLDS, ReGameDLL, AmxModX 1.9.0, ReAPI
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

#include <amxmodx>
#include <reapi>

enum { MODE_NORMAL_TEAM, MODE_RANDOM_TEAM }
enum { SPEC_ALWAYS, SPEC_AFTER_JOIN }

new HookChain:HookShowMenuPre
new Mode, Spectators, Appearance, Unlimited, Float:TimeLimit, AdminFlags = ADMIN_BAN, Autojoin, AutojoinImminity = ADMIN_BAN
new Float:NextChooseTeamTime[MAX_PLAYERS + 1]

public plugin_init()
{
register_plugin("Team Select", "1.5.0", "F@nt0M")
register_dictionary("teamselect.txt")

RegisterHookChain(RG_ShowVGUIMenu, "ShowVGUIMenu_Pre", false)
RegisterHookChain(RG_HandleMenu_ChooseTeam, "HandleMenu_ChooseTeam_Pre", false)
RegisterHookChain(RG_HandleMenu_ChooseTeam, "HandleMenu_ChooseTeam_Post", true)
DisableHookChain(HookShowMenuPre = RegisterHookChain(RG_ShowMenu, "ShowMenu_Pre", false))

new pcvar
pcvar = create_cvar("amx_ts_mode", "0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_MODE_DESC"), true, 0.0, true, 1.0)
bind_pcvar_num(pcvar, Mode)

pcvar = create_cvar("amx_ts_spec", "0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_SPEC_DESC"), true, 0.0, true, 1.0)
bind_pcvar_num(pcvar, Spectators)

pcvar = create_cvar("amx_ts_appearance", "0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_APPEARANCE_DESC"), true, 0.0, true, 1.0)
bind_pcvar_num(pcvar, Appearance)

pcvar = create_cvar("amx_ts_unlimited", "0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_UNLIMITED_DESC"), true, 0.0, true, 1.0)
bind_pcvar_num(pcvar, Unlimited)

pcvar = create_cvar("amx_ts_time_limit", "0.0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_TIME_LIMIT_DESC"), true, 0.0)
bind_pcvar_float(pcvar, TimeLimit)

pcvar = create_cvar("amx_ts_autojoin", "0", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_AUTOJOIN_DESC"), true, 0.0, true, 1.0)
bind_pcvar_num(pcvar, Autojoin)

pcvar = create_cvar("amx_ts_admin_flags", "d", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_FLAGS_DESC"))
hook_cvar_change(pcvar, "HookChangeFlag")

pcvar = create_cvar("amx_ts_autojoin_immunity", "d", FCVAR_SERVER, fmt("%L", LANG_SERVER, "TS_AUTOJOIN_IMMUNITY_DESC"), true, 0.0, true, 1.0)
hook_cvar_change(pcvar, "HookChangeImmunity")
}

public HookChangeFlag(const pcvar, const oldValue[], const newValue[]) AdminFlags = read_flags(newValue);
public HookChangeImmunity(const pcvar, const oldValue[], const newValue[]) AutojoinImminity = read_flags(newValue);

public client_putinserver(id)
{
NextChooseTeamTime[id] = 0.0;
if (!Autojoin) return
if (AutojoinImminity && (get_user_flags(id) & AutojoinImminity == AutojoinImminity)) return
rg_join_team(id, rg_get_join_team_priority())
}

public ShowVGUIMenu_Pre(const id, VGUIMenu:menuType)
{
if (is_user_bot(id) || menuType != VGUI_Menu_Team) return HC_CONTINUE

if (TimeLimit && NextChooseTeamTime[id] >= get_gametime())
{
client_printex(id, print_center, "#Only_1_Team_Change")
return HC_SUPERCEDE
}

new bool:newPlayer = bool:(TeamName:get_member(id, m_iTeam) == TEAM_UNASSIGNED)
SetGlobalTransTarget(id)

new menu[MAX_MENU_LENGTH], keys
new len = formatex(menu, charsmax(menu), "\w%l^n^n", "TS_SELECT_TEAM")
if (Mode == MODE_NORMAL_TEAM)
{
len += formatex(menu[len], charsmax(menu) - len, "\d[\r1\d] \r%l \d[\y%d\d]^n", "TS_TEAM_T", get_member_game(m_iNumTerrorist))
len += formatex(menu[len], charsmax(menu) - len, "\d[\r2\d] \r%l \d[\y%d\d]^n", "TS_TEAM_CT", get_member_game(m_iNumCT))
keys |= MENU_KEY_1 | MENU_KEY_2
}
else
{
len += formatex(menu[len], charsmax(menu) - len, "\d[\r1\d] \r%l^n", newPlayer ? "TS_ENTER_GAME" : "TS_CHANGE_TEAM")
keys |= MENU_KEY_1
}

if (Spectators == SPEC_ALWAYS || (Spectators == SPEC_AFTER_JOIN && !newPlayer) || (AdminFlags && (get_user_flags(id) & AdminFlags) == AdminFlags))
{
len += formatex(menu[len], charsmax(menu) - len, "^n\d[\r6\d] \w%l^n", "TS_SPECTATOR")
keys |= MENU_KEY_6
}

if (!newPlayer)
{
len += formatex(menu[len], charsmax(menu) - len, "^n^n\d[\r0\d] \w%l^n", "TS_CLOSE")
keys |= MENU_KEY_0
}

set_member(id, m_bForceShowMenu, true)
SetHookChainArg(3, ATYPE_INTEGER, keys)
SetHookChainArg(4, ATYPE_STRING, menu)

if (strlen(menu) > 192) EnableHookChain(HookShowMenuPre)
return HC_CONTINUE
}

// Fix menu limit in ReGameDLL (https://github.com/s1lentq/ReGameDLL_CS/blob/9d89a347fa22662b716697c97150ddea2bd00d99/regamedll/dlls/client.cpp#L394)
public ShowMenu_Pre(const id, const keys, const time, const needMore, const menu[])
{
DisableHookChain(HookShowMenuPre)
show_menu(id, keys, menu, time)
set_member(id, m_iMenu, Menu_ChooseTeam) // AMXX overide m_iMenu after show_menu
return HC_SUPERCEDE
}

public HandleMenu_ChooseTeam_Pre(const id, const MenuChooseTeam:slot) {
if (is_user_bot(id)) return HC_CONTINUE

if (slot == MenuChoose_Spec)
{
if (is_user_alive(id)) user_silentkill(id)
}
else
{
if (Mode == MODE_RANDOM_TEAM)
{
new MenuChooseTeam:team
switch (TeamName:get_member(id, m_iTeam)) {
case TEAM_TERRORIST: team = MenuChoose_CT
case TEAM_CT: team = MenuChoose_T
default: team = MenuChoose_AutoSelect
}
SetHookChainArg(2, ATYPE_INTEGER, team)
}

if (!Appearance)
{
if (is_user_alive(id)) user_silentkill(id)
set_member_game(m_bSkipShowMenu, true)
}
}
return HC_CONTINUE
}

public HandleMenu_ChooseTeam_Post(const id, const MenuChooseTeam:slot)
{
if (!GetHookChainReturn(ATYPE_INTEGER)) return
if (Unlimited) set_member(id, m_bTeamChanged, false)

NextChooseTeamTime[id] = get_gametime() + TimeLimit
if (slot == MenuChoose_Spec || Appearance) return

set_member_game(m_bSkipShowMenu, false)
if (get_member(id, m_bJustConnected))
{
set_member(id, m_iJoiningState, GETINTOGAME)
set_member(id, m_bJustConnected, false)
}
set_member(id, m_iMenu, Menu_ChooseAppearance)
rg_internal_cmd(id, "joinclass", "5")
}
ПОМОГИТЕ
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
80
Реакции
3
Помог
4 раз(а)
в чём прикол компилить онлайн?
на тебе компилятор 5263
в архиве компилятор и твой плагин!
 

Вложения

  • Нравится
Реакции: Ayk
Сообщения
4
Реакции
-2
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Abram4ik, Огромное спасибо,очень помог,у меня просто есть локальный компилятор но он так же выдает ошибки,не знаю причину
 
Сообщения
957
Реакции
1,185
Помог
52 раз(а)
Abram4ik, Огромное спасибо,очень помог,у меня просто есть локальный компилятор но он так же выдает ошибки,не знаю причину
Причина в нежелании разобраться в той области, в которую попали.
 
  • Нравится
Реакции: Ayk
Статус
В этой теме нельзя размещать новые ответы.

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

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