Проблема с компиляцией плагин [GM] Weapon Models

Сообщения
18
Реакции
0
Предупреждения
5
Ошибка
// C:\Users\lesha\Desktop\cs\compile\gm_weapon_models.sma(49) : error 017: undefined symbol "RG_CBasePlayerWeapon_DefaultDeploy"
// C:\Users\lesha\Desktop\cs\compile\gm_weapon_models.sma(49) : warning 215: expression has no effect
// C:\Users\lesha\Desktop\cs\compile\gm_weapon_models.sma(49) : error 001: expected token: ";", but found ")"
// C:\Users\lesha\Desktop\cs\compile\gm_weapon_models.sma(49) : error 029: invalid expression, assumed zero
// C:\Users\lesha\Desktop\cs\compile\gm_weapon_models.sma(49) : fatal error 107: too many error messages on one line
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294 (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: Dec 3 2021 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
ReGamedll
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
Версия Metamod
Metamod-r v1.3.0.149, API (5:13)
Metamod-r build: 11:31:17 Apr 23 2024
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/603a257
Список метамодулей
[ 1] Reunion          RUN   -    reunion_mm_i386.so           v0.2.0.13        ini  Start Never
[ 2] AMX Mod X RUN - amxmodx.so v1.9.0.5294 ini Start ANY
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 4] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 5] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 6] CSX RUN - csx_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 7] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl2 ANY Never
[ 8] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl2 ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl2 ANY
[10] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl2 ANY ANY
[11] Buttons Manager RUN - buttonsmanager_amxx_i386.so v0.0.1 pl2 ANY ANY
[12] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl2 ANY ANY
[13] gRIP RUN - grip_amxx_i386.so v0.1.3 Beta pl2 ANY ANY
13 plugins, 13 running
Список плагинов
[  1] Admin Load              3.9.3 Dev   F@nt0M            admin_loader_fo  running  
[ 2] FreshBans 1.4.6b kanagava fresh_bans.amxx running
[ 3] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 4] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 5] Anti Flood 1.9.0.5294 AMXX Dev Team antiflood.amxx running
[ 6] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 7] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 8] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 9] Maps Menu 1.4.1 neugomon mapsmenu.amxx running
[ 10] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 11] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 12] Restrict Weapons 1.9.0.5294 AMXX Dev Team restmenu.amxx running
[ 13] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 14] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 15] Advanced MapChooser 1.4 neygomon advanced_mapcho running
[ 16] Private Message 0.6 Denzer private_message running
[ 17] Give_Girls 1.0.0 okeeey Give_Girls.amxx running
[ 18] iHOOK 1.0 arttty7 iHOOK.amxx running
[ 19] [JBE] Oaio 21.03.2020 PAffAEJIkA :3 jbe_oaio.amxx running
[ 20] Kick 24.03.2020 PAffAEJIkA :3 jbe_kick.amxx running
[ 21] [JBE] Grab + Menu 5.2 Edit By NiKiTa jbe_grab.amxx running
[ 22] [JBE] Director menu 1.0 Pozetiv4ik jbe_directormen running
[ 23] [S_JB] Core 3.7.4 OMID jbe_core.amxx debug
[ 24] [S_JB] Chatmanager 3.7.4 OMID jbe_prefixes.am running
[ 25] [JB] Guard Weapons 3.4 Arttty7 & NIKOTI jbe_guard_weapo debug
[ 26] [S_JB] Teleport 3.7.4 OMID jbe_teleport.am running
[ 27] [S_JB] Меню выд 3.7.4 OMID jbe_give_menu.a running
[ 28] [S_JB] Advertising Man 3.7.4 x64 & OMID jbe_ad.amxx running
[ 29] [S_JB] Boss menu 3.7.4 HOBOSTI & OMID jbe_boss.amxx debug
[ 30] [JBE] Control Music in 3.7.4 g3cKpunTop jbe_music_game. running
[ 31] [JailMode] Galaxy 3.7.4 AlexandrFiner jbe_dm_galaxy.a running
[ 32] [JailMode] He 3.7.4 AlexandrFiner jbe_dm_he.amxx running
[ 33] [JailMode] Hot Potato 3.7.4 AlexandrFiner jbe_dm_hot_pota running
[ 34] [JBE_DM] Birth Day 3.7.4 Freedo.m jbe_dm_birthday running
[ 35] [JBE_DM] Ringolevio 1.1 Freedo.m jbe_dm_ringolev running
[ 36] [JBE_DM] Sparta 1.1 Freedo.m jbe_dm_sparta.a running
[ 37] [JBE_DM] Ghosts 1.1 Freedo.m jbe_dm_ghosts.a running
[ 38] Discord Reports 0.2 paffgame discord.amxx running
[ 39] SF Warn Menu 0.1.4g serfreeman1337 sf_admin_warns. running
[ 40] [ZP] Weapon: AK-47 Lon 1.0 Batcon : Edit : zp_extra_aklong running
[ 41] [ZP] Extra: Infinitys 1.0 Crock / =) (Popr azp_weapon_infi running
41 plugins, 41 running
Автор плагина
Noob_with_cheats
Версия плагина
1.1.0
Исходный код
#include <amxmodx>
#include <fakemeta>
#include <reapi>

#pragma semicolon 1

#define MAX_MODELS_LENGTH 128

enum _:ArrayData
{
SaveType: iWmType,
WeaponIdType: iWmWeapon,
iWmModelW,
TeamName: iTeam,
szWmParam[64],
szWmModelP[MAX_MODELS_LENGTH],
szWmModelV[MAX_MODELS_LENGTH],
szWmModelW[MAX_MODELS_LENGTH]
}

enum _:PlayerModels
{
SaveType: iPriority,
iModelW,
szModelP[MAX_MODELS_LENGTH],
szModelV[MAX_MODELS_LENGTH],
szModelW[MAX_MODELS_LENGTH]
}

enum SaveType
{
WM_NONE,
WM_ALL,
WM_TEAM,
WM_ONLY_STEAM,
WM_FLAGS,
WM_STEAM,
WM_NICK
}

new Array: g_aWeapons, SaveType: g_iType;
new g_aPlayerWeapon[MAX_PLAYERS * 3 + 1][WeaponIdType][PlayerModels];

public plugin_init()
{
register_plugin("[GM] Weapon Models", "2.0.0", "[GM] NWC");
register_dictionary("gm_weapon_models.txt");

RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "@CBasePlayerWeapon_DefaultDeploy_Pre");
RegisterHookChain(RG_CWeaponBox_SetModel, "@CWeaponBox_SetModel_Pre");
RegisterHookChain(RG_CBasePlayer_ThrowGrenade, "@CBasePlayer_ThrowGrenade_Post", true);
RegisterHookChain(RG_PlantBomb, "@PlantBomb_Post", true);
}

public plugin_precache()
{
new szDir[128];
get_localinfo("amxx_configsdir", szDir, charsmax(szDir));
add(szDir, charsmax(szDir), "/plugins/gm_plugins/weapon_models.ini");

g_aWeapons = ArrayCreate(ArrayData);

new INIParser: hParser = INI_CreateParser();
INI_SetReaders(hParser, "parse_key_value", "parse_new_section");

if (!INI_ParseFile(hParser, szDir))
{
INI_DestroyParser(hParser);
set_fail_state("%l %l", "WM_FILE_CANT", file_exists(szDir) ? "WM_READ" : "WM_FIND", szDir);
}

INI_DestroyParser(hParser);
}

// Deploy Weapon
@CBasePlayerWeapon_DefaultDeploy_Pre(const iEnt)
{
if (is_nullent(iEnt)) return HC_CONTINUE;

new iPlayer = get_member(iEnt, m_pPlayer);

new WeaponIdType: iWeapon = WeaponIdType: get_member(iEnt, m_iId);

if (g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelV])
SetHookChainArg(2, ATYPE_STRING, g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelV]);
else
if (g_aPlayerWeapon[iPlayer][iWeapon][szModelV])
SetHookChainArg(2, ATYPE_STRING, g_aPlayerWeapon[iPlayer][iWeapon][szModelV]);

if (g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelP])
SetHookChainArg(3, ATYPE_STRING, g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelP]);
else
if (g_aPlayerWeapon[iPlayer][iWeapon][szModelP])
SetHookChainArg(3, ATYPE_STRING, g_aPlayerWeapon[iPlayer][iWeapon][szModelP]);

return HC_CONTINUE;
}
// Drop
@CWeaponBox_SetModel_Pre(const iWeaponBox)
{
new iEnt = func_GetWeaponBoxWeapon(iWeaponBox);
if (iEnt == NULLENT) return HC_CONTINUE;

new WeaponIdType: iWeapon = WeaponIdType: get_member(iEnt, m_iId);
new iPlayer = get_entvar(iWeaponBox, var_owner);

if (g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelW])
SetHookChainArg(2, ATYPE_STRING, g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelW]);
else
if (g_aPlayerWeapon[iPlayer][iWeapon][szModelW])
SetHookChainArg(2, ATYPE_STRING, g_aPlayerWeapon[iPlayer][iWeapon][szModelW]);

return HC_CONTINUE;
}
// Grenade
@CBasePlayer_ThrowGrenade_Post(const iPlayer, const iGrenade)
{
new iEnt = GetHookChainReturn(ATYPE_INTEGER);
if (is_nullent(iEnt)) return HC_CONTINUE;

new WeaponIdType: iWeapon = WeaponIdType: get_member(iGrenade, m_iId);

if (g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelW])
{
set_entvar(iEnt, var_modelindex, g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][iModelW]);
set_entvar(iEnt, var_model, g_aPlayerWeapon[get_plWeapon(iPlayer)][iWeapon][szModelW]);
}
else
if (g_aPlayerWeapon[iPlayer][iWeapon][szModelW])
{
set_entvar(iEnt, var_modelindex, g_aPlayerWeapon[iPlayer][iWeapon][iModelW]);
set_entvar(iEnt, var_model, g_aPlayerWeapon[iPlayer][iWeapon][szModelW]);
}

return HC_CONTINUE;
}
// Plant Bomb
@PlantBomb_Post(const iPlayer)
{
new iEnt = GetHookChainReturn(ATYPE_INTEGER);

if (g_aPlayerWeapon[get_plWeapon(iPlayer)][WEAPON_C4][szModelW])
{
set_entvar(iEnt, var_modelindex, g_aPlayerWeapon[get_plWeapon(iPlayer)][WEAPON_C4][iModelW]);
set_entvar(iEnt, var_model, g_aPlayerWeapon[get_plWeapon(iPlayer)][WEAPON_C4][szModelW]);
}

return HC_CONTINUE;
}

public client_putinserver(iPlayer)
{
for (new TeamName: j,k; j < TEAM_SPECTATOR; j++)
{
switch (j)
{
case TEAM_UNASSIGNED: {k = iPlayer;}
case TEAM_TERRORIST: {k = MAX_PLAYERS + iPlayer;}
case TEAM_CT: {k = MAX_PLAYERS * 2 + iPlayer;}
default: {k = 0;}
}

for (new WeaponIdType: i = WEAPON_P228; i <= WEAPON_P90; i++)
{
g_aPlayerWeapon[k][i][iPriority] = WM_NONE;
g_aPlayerWeapon[k][i][szModelP][0] = EOS;
g_aPlayerWeapon[k][i][szModelV][0] = EOS;
g_aPlayerWeapon[k][i][szModelW][0] = EOS;
}
}

new iSize = ArraySize(g_aWeapons);
new aData[ArrayData], WeaponIdType: iWeapon;


for (new i, k; i < iSize; i++)
{
ArrayGetArray(g_aWeapons, i, aData);
iWeapon = aData[iWmWeapon];

switch (aData[iTeam])
{
case TEAM_UNASSIGNED: {k = iPlayer;}
case TEAM_TERRORIST: {k = MAX_PLAYERS + iPlayer;}
case TEAM_CT: {k = MAX_PLAYERS * 2 + iPlayer;}
default: {k = 0;}
}

if (g_aPlayerWeapon[k][iWeapon][iPriority] < aData[iWmType])
{
if (is_replace(iPlayer, aData[iWmType], aData[szWmParam]))
{
g_aPlayerWeapon[k][iWeapon][iPriority] = aData[iWmType];
if (aData[szWmModelP]) copy(g_aPlayerWeapon[k][iWeapon][szModelP], MAX_MODELS_LENGTH - 1, aData[szWmModelP]);
if (aData[szWmModelV]) copy(g_aPlayerWeapon[k][iWeapon][szModelV], MAX_MODELS_LENGTH - 1, aData[szWmModelV]);
if (aData[szWmModelW]) copy(g_aPlayerWeapon[k][iWeapon][szModelW], MAX_MODELS_LENGTH - 1, aData[szWmModelW]);
if (aData[iWmModelW]) g_aPlayerWeapon[k][iWeapon][iModelW] = aData[iWmModelW];
}
}
else
if (aData[iWmType] == WM_ONLY_STEAM && is_user_steam(iPlayer))
{
if (!aData[szWmModelP]) copy(g_aPlayerWeapon[k][iWeapon][szModelP], MAX_MODELS_LENGTH - 1, aData[szWmModelP]);
if (!aData[szWmModelV]) copy(g_aPlayerWeapon[k][iWeapon][szModelV], MAX_MODELS_LENGTH - 1, aData[szWmModelV]);
if (!aData[szWmModelW]) copy(g_aPlayerWeapon[k][iWeapon][szModelW], MAX_MODELS_LENGTH - 1, aData[szWmModelW]);
if (aData[iWmModelW]) g_aPlayerWeapon[k][iWeapon][iModelW] = aData[iWmModelW];
}
else
if (aData[iWmType] == WM_ALL)
{
if (!aData[szWmModelP]) copy(g_aPlayerWeapon[k][iWeapon][szModelP], MAX_MODELS_LENGTH - 1, aData[szWmModelP]);
if (!aData[szWmModelV]) copy(g_aPlayerWeapon[k][iWeapon][szModelV], MAX_MODELS_LENGTH - 1, aData[szWmModelV]);
if (!aData[szWmModelW]) copy(g_aPlayerWeapon[k][iWeapon][szModelW], MAX_MODELS_LENGTH - 1, aData[szWmModelW]);
if (aData[iWmModelW]) g_aPlayerWeapon[k][iWeapon][iModelW] = aData[iWmModelW];
}
}
}

stock func_GetWeaponBoxWeapon(const iWeaponBox)
{
for (new i, iWeapon; i < MAX_ITEM_TYPES; i++)
{
iWeapon = get_member(iWeaponBox, m_WeaponBox_rgpPlayerItems, i);
if (!is_nullent(iWeapon)) return iWeapon;
}

return NULLENT;
}

stock get_plWeapon(iPlayer)
{
switch (get_member(iPlayer, m_iTeam))
{
case TEAM_UNASSIGNED: {return iPlayer;}
case TEAM_TERRORIST: {return MAX_PLAYERS + iPlayer;}
case TEAM_CT: {return MAX_PLAYERS * 2 + iPlayer;}
}
return 0;
}

stock bool: is_replace(const iPlayer, const SaveType: szType, const szParam[])
{
if (szType == WM_ALL) return true;
if (szType == WM_ONLY_STEAM && is_user_steam(iPlayer)) return true;

new szCopy[MAX_AUTHID_LENGTH];
if (szType == WM_NICK) get_user_name(iPlayer, szCopy, charsmax(szCopy));
else if (szType == WM_STEAM) get_user_authid(iPlayer, szCopy, charsmax(szCopy));
if (equal(szParam, szCopy)) return true;

if (szType == WM_FLAGS && get_user_flags(iPlayer) & read_flags(szParam)) return true;

return false;
}

public bool: parse_key_value(INIParser: hParser, const szBuffer[])
{
if (g_iType == WM_NONE) return true;

new aData[ArrayData], szWeapon[16], szTeam[2];
aData[iWmType] = g_iType;

if (g_iType < WM_FLAGS)
{
parse(szBuffer, szTeam, charsmax(szTeam),
szWeapon, charsmax(szWeapon),
aData[szWmModelP], MAX_MODELS_LENGTH - 1,
aData[szWmModelV], MAX_MODELS_LENGTH - 1,
aData[szWmModelW], MAX_MODELS_LENGTH - 1);
}
else
{
parse(szBuffer, aData[szWmParam], charsmax(aData[szWmParam]),
szTeam, charsmax(szTeam),
szWeapon, charsmax(szWeapon),
aData[szWmModelP], MAX_MODELS_LENGTH - 1,
aData[szWmModelV], MAX_MODELS_LENGTH - 1,
aData[szWmModelW], MAX_MODELS_LENGTH - 1);
}

if (!aData[szWmModelP] && !aData[szWmModelV] && !aData[szWmModelW]) return true;

switch (szTeam[0])
{
case 'T', 't': {aData[iTeam] = TEAM_TERRORIST;}
case 'C', 'c': {aData[iTeam] = TEAM_CT;}
case EOS: {aData[iTeam] = TEAM_UNASSIGNED;}
default:
{
log_amx("%l", "WM_NONE_PARAM_FOR_TEAM", szTeam);
return true;
}
}

if ((aData[iWmWeapon] = rg_get_weapon_info(fmt("weapon_%s", szWeapon), WI_ID)) == WEAPON_NONE)
{
log_amx("%l", "WM_BAD_WEAPON", szWeapon);
return true;
}

if ((g_iType >= WM_FLAGS) && !aData[szWmParam])
{
log_amx("%l", "WM_NONE_PARAM_FOR_TYPE", g_iType, szBuffer);
return true;
}

if (aData[szWmModelP]) precache_model(aData[szWmModelP]);
if (aData[szWmModelV]) precache_model(aData[szWmModelV]);
if (aData[szWmModelW])
{
switch (aData[iWmWeapon])
{
case WEAPON_FLASHBANG, WEAPON_HEGRENADE, WEAPON_SMOKEGRENADE, WEAPON_C4: {aData[iWmModelW] = precache_model(aData[szWmModelW]);}
default : {precache_model(aData[szWmModelW]);}
}

}

ArrayPushArray(g_aWeapons, aData);
return true;
}

public bool: parse_new_section(INIParser: hParser, const szSection[])
{
if (equal(szSection, "ALL STEAMS")) g_iType = WM_ONLY_STEAM;
else
{
switch (szSection[0])
{
case 'A': {g_iType = WM_ALL;}
case 'F': {g_iType = WM_FLAGS;}
case 'S': {g_iType = WM_STEAM;}
case 'N': {g_iType = WM_NICK;}
default: {g_iType = WM_NONE; log_amx("%l", "WM_BAD_TYPE", szSection);}
}
}

return true;
}
Решил поставить на сервер данный плагин, и при компиляции выдает ошибки.
 

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

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