AUW, ultimate_weapons_bypass не работают

Harakiry

amxx_cracker_amx v1.0
Сообщения
25
Реакции
-4
Ошибка
L 08/01/2022 - 07:09:03: Invalid map handle provided (0)
L 08/01/2022 - 07:09:03: [AMXX] Run time error 10 (plugin "auw.amxx") (native "TrieGetCell") - debug not enabled!
L 08/01/2022 - 07:09:03: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 08/01/2022 - 07:09:03: Unhandled dynamic native error
L 08/01/2022 - 07:09:03: [AMXX] Displaying debug trace (plugin "ultimate_weapons_bypass.amxx", version "unknown")
L 08/01/2022 - 07:09:03: [AMXX] Run time error 10: native error (native "auw_get_weapon_uid")
L 08/01/2022 - 07:09:03: [AMXX] [0] ultimate_weapons_bypass.sma::weapons_get_weapon_uid (line 60)
L 08/01/2022 - 07:09:03: Unhandled dynamic native error
L 08/01/2022 - 07:09:03: [AMXX] Run time error 10 (plugin "vip_rbs.amxx") (native "weapons_get_weapon_uid") - debug not enabled!
L 08/01/2022 - 07:09:03: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
ОС
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.11.0.777-dev
Build date: 21:17:20 Jun 29 2022 (3000)
Build from: https://github.com/dreamstalker/rehlds/commit/be0e1c8
ReGamedll
ReGameDLL version: 5.21.0.556-dev
Build date: 08:43:58 Jul 22 2022
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/1081301
Версия 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/0cf2f7
Список метамодулей
[ 1] Reunion       RUN   -    reunion.so                v0.1.0.137       ini  Start Never
[ 2] AMX Mod X RUN - amxmodx.so v1.9.0.5263 ini Start ANY
[ 3] MySQL RUN - mysql_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 4] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 5] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 6] CSX RUN - csx_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 7] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 8] Engine RUN - engine_amxx_i386.so v1.9.0.5263 pl2 ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5263 pl2 ANY
[10] ReAPI RUN - reapi_amxx_i386.so v5.21.0.252-dev pl2 ANY Never
Список плагинов
[  1] Admin Loader            3.5         neygomon          admin_loader.am  running  
[ 2] FreshBans 1.4.6b kanagava fresh_bans.amxx running
[ 3] Admin Chat 1.9.0.5263 AMXX Dev Team adminchat.amxx running
[ 4] Admin Commands 1.9.0.5263 AMXX Dev Team admincmd.amxx running
[ 5] Anti Flood 1.9.0.5263 AMXX Dev Team antiflood.amxx running
[ 6] Commands Menu 1.9.0.5263 AMXX Dev Team cmdmenu.amxx running
[ 7] Info. Messages 1.9.0.5263 AMXX Dev Team imessage.amxx running
[ 8] Menus Front-End 1.9.0.5263 AMXX Dev Team menufront.amxx running
[ 9] Maps Menu 1.9.0.5263 AMXX Dev Team mapsmenu.amxx running
[ 10] NextMap 1.9.0.5263 AMXX Dev Team nextmap.amxx running
[ 11] Nextmap Chooser 1.9.0.5263 AMXX Dev Team mapchooser.amxx running
[ 12] Players Menu 1.9.0.5263 AMXX Dev Team plmenu.amxx running
[ 13] Plugin Menu 1.9.0.5263 AMXX Dev Team pluginmenu.amxx running
[ 14] Restrict Weapons 1.9.0.5263 AMXX Dev Team restmenu.amxx running
[ 15] TimeLeft 1.9.0.5263 AMXX Dev Team timeleft.amxx running
[ 16] Scrolling Message 1.9.0.5263 AMXX Dev Team scrollmsg.amxx running
[ 17] Admin Votes 1.9.0.5263 AMXX Dev Team adminvote.amxx running
[ 18] CS Misc. Stats 1.9.0.5263 AMXX Dev Team miscstats.amxx running
[ 19] CS Stats Logging 1.9.0.5263 AMXX Dev Team stats_logging.a running
[ 20] Stats Configuration 1.9.0.5263 AMXX Dev Team statscfg.amxx running
[ 21] [190] VIP RBS 20.07.20 SKAJIbnEJIb vip_rbs.amxx running
[ 22] Advanced Ultimate Weap 0.1.0b steelzzz auw.amxx running
[ 23] unknown unknown unknown ultimate_weapon debug
23 plugins, 23 running
Автор плагина
steelzzz
Версия плагина
0.1.0b
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <reapi>
#include <fakemeta>
#include <hamsandwich>

#include <auw>

new const PLUGIN_NAME[] = "Advanced Ultimate Weapons";
new const PLUGIN_VERSION[] = "0.1.0b";

enum _:eCvarsData
{
FLAG_ACCESS[5],
MENU_ACCESS_TYPE,
DISCOUNT,
Float: BUYTIME,
MENU_ROUND,
BUYZONE,
MENU_DAMAGE,
CMD_ACCESS[5],
GIVE_TYPE,
PICKUP_ACCESS_TYPE,
TRACE_TYPE
}; new g_pCvar[eCvarsData];

enum eHamHooks
{
HamHook: TRACEATTACK[5],
HamHook: TOUCH
}; new g_pHamHooks[eHamHooks];

enum eReapiHooks
{
HookChain: DEPLOY,
HookChain: SETMODEL,
}; new g_pReapiHooks[eReapiHooks];

#define var_weaponkey var_iuser4
#define var_modelview var_noise1
#define var_modelplayer var_noise2
#define var_modelworld var_message
#define var_weapontrace var_iuser2
#define var_weaponflags var_iuser1

#define getWeaponKey(%0) get_entvar(%0, var_weaponkey)
#define getWeaponModelView(%0,%1,%2) get_entvar(%0, var_modelview, %1, %2)
#define getWeaponModelPlayer(%0,%1,%2) get_entvar(%0, var_modelplayer, %1, %2)
#define getWeaponModelWorld(%0,%1,%2) get_entvar(%0, var_modelworld, %1, %2)
#define getWeaponTrace(%0) get_entvar(%0, var_weapontrace)
#define getWeaponFlags(%0) get_entvar(%0, var_weaponflags)

#define setWeaponKey(%0,%1) set_entvar(%0, var_iuser4, %1)
#define setWeaponModelView(%0,%1) set_entvar(%0, var_modelview, %1)
#define setWeaponModelPlayer(%0,%1) set_entvar(%0, var_modelplayer, %1)
#define setWeaponModelWorld(%0,%1) set_entvar(%0, var_modelworld, %1)
#define setWeaponTrace(%0,%1) set_entvar(%0, var_weapontrace, %1)
#define setWeaponFlags(%0,%1) set_entvar(%0, var_weaponflags, %1)

#define IsComment(%0) (%0[0] == EOS || %0[0] == 10 || %0[0] == 13 || %0[0] == ';' || %0[0] == '#' || (%0[0] == '/' && %0[1] == '/'))
#define rg_get_user_money(%0) get_member(%0, m_iAccount)
#define MAXWEAPONS 128

#define IsPlayer(%1) bool:(%1 && %1 <= MAX_PLAYERS)
#define get_bit(%1,%2) (%1 & (1 << (%2 & 31)))
#define set_bit(%1,%2) (%1 |= (1 << (%2 & 31)))
#define reset_bit(%1,%2) (%1 &= ~(1 << (%2 & 31)))

new g_bClientConnected;
new Array: g_aWeaponData;
new Trie: g_tWeaponClcmd;
new g_iWeaponsCount;
new g_iLaserBeam;
new g_pCvarBuyTime;
new g_iClcmdIndex[MAXWEAPONS];
new Float: g_flTouchTime[MAX_PLAYERS + 1];
new const sFile[] = "ultimate_weapons.ini";

new g_iForwards[eAUWForwards];

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, "steelzzz");

register_clcmd("say /ultimate", "Command_ShowUltimateMenu");
register_concmd("buyultimate", "Command_ShowUltimateMenu");
register_concmd("weapons_give", "Command_GiveWeapon");

g_pHamHooks[TRACEATTACK][0] = RegisterHam(Ham_TraceAttack, "player", "CWeapon_TraceAttack_Post", .Post = true);
g_pHamHooks[TRACEATTACK][1] = RegisterHam(Ham_TraceAttack, "info_target", "CWeapon_TraceAttack_Post", .Post = true);
g_pHamHooks[TRACEATTACK][2] = RegisterHam(Ham_TraceAttack, "func_breakable", "CWeapon_TraceAttack_Post", .Post = true);
g_pHamHooks[TRACEATTACK][3] = RegisterHam(Ham_TraceAttack, "hostage_entity", "CWeapon_TraceAttack_Post", .Post = true);
g_pHamHooks[TRACEATTACK][4] = RegisterHam(Ham_TraceAttack, "worldspawn", "CWeapon_TraceAttack_Post", .Post = true);
g_pHamHooks[TOUCH] = RegisterHam(Ham_Touch, "weaponbox", "CWeapon_Touch_Pre", .Post = false);

g_pReapiHooks[DEPLOY] = RegisterHookChain(RG_CBasePlayerWeapon_DefaultDeploy, "CWeapon_DefaultDeploy_Pre", .post = false);
g_pReapiHooks[SETMODEL] = RegisterHookChain(RG_CWeaponBox_SetModel, "CWeapon_SetModel_Pre", .post = false);

stateHooks(true);

register_dictionary("auw.txt");

g_iForwards[eAUWForwards_OnGiveItemPre] = CreateMultiForward("auw_on_give_item_pre", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL, FP_CELL);
}

public plugin_cfg()
{
register_cvar("auw_version", PLUGIN_VERSION, FCVAR_SERVER | FCVAR_SPONLY);

bind_pcvar_string(create_cvar("weapons_flag", "t", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_FLAG")), g_pCvar[FLAG_ACCESS], sizeof(g_pCvar[FLAG_ACCESS]));
bind_pcvar_num(create_cvar("weapons_access", "2", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_ACCESS"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 2.0), g_pCvar[MENU_ACCESS_TYPE]);
bind_pcvar_num(create_cvar("weapons_disc", "30", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_DISC"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 100.0), g_pCvar[DISCOUNT]);
bind_pcvar_float(create_cvar("weapons_time", "2.0", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_TIME"), .has_min = true, .min_val = 0.0), g_pCvar[BUYTIME]);
bind_pcvar_num(create_cvar("weapons_firstround", "3", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_FIRSTROUND"), .has_min = true, .min_val = 0.0), g_pCvar[MENU_ROUND]);
bind_pcvar_num(create_cvar("weapons_zone", "1", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_ZONE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), g_pCvar[BUYZONE]);
bind_pcvar_num(create_cvar("weapons_menu_dmg", "0", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_MENU_DMG"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), g_pCvar[MENU_DAMAGE]);
bind_pcvar_string(create_cvar("weapons_cmd_access", "t", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_CMD_ACCESS")), g_pCvar[CMD_ACCESS], sizeof(g_pCvar[CMD_ACCESS]));
bind_pcvar_num(create_cvar("weapons_give_type", "2", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_GIVE_TYPE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 2.0), g_pCvar[GIVE_TYPE]);
bind_pcvar_num(create_cvar("weapons_pickup_access_type", "0", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_TOUCH"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), g_pCvar[PICKUP_ACCESS_TYPE]);
bind_pcvar_num(create_cvar("weapons_trace_type", "0", .description = fmt("%L", LANG_SERVER, "CVAR_WEAPONS_TRACE_TYPE"), .has_min = true, .min_val = 0.0, .has_max = true, .max_val = 1.0), g_pCvar[TRACE_TYPE]);

g_pCvarBuyTime = get_cvar_pointer("mp_buytime");

AutoExecConfig(true, "auw");
}

public plugin_natives()
{
register_native(__auw__native_str__get_weapon_uid, "Native_GetWeaponUid", false);
register_native(__auw__native_str__give_weapon, "Native_GiveWeapon", false);
register_native(__auw__native_str__valid_weapon, "Native_ValidWeapon", false);
register_native(__auw__native_str__get_weapons_data, "Native_GetWeaponsData", false);
}

public Native_GetWeaponUid(iPlugin, iParams)
{
enum { arg_buyname = 1, arg_is_uid_with_offset };

new sWeaponName[32];
get_string(arg_buyname, sWeaponName, charsmax(sWeaponName));

new iWeaponId;

if(!TrieGetCell(g_tWeaponClcmd, sWeaponName, iWeaponId))
{
return -1;
}

if(!get_param(arg_is_uid_with_offset))
{
return iWeaponId;
}

return iWeaponId + AUW_IMPULSE_OFFSET;
}

public Native_GiveWeapon(iPlugin, iParams)
{
enum { arg_player = 1, arg_weaponname, arg_show_notification, arg_uid, arg_is_uid_with_offset, arg_buy };

static forceCheckUid; forceCheckUid = false;

new iPlayer = get_param(arg_player);

if(!is_user_connected(iPlayer))
{
return false;
}

new sWeaponName[32];
get_string(arg_weaponname, sWeaponName, charsmax(sWeaponName));

new iWeaponId;
new uId = get_param(arg_uid);

if(uId != -1)
{
forceCheckUid = true;
if(get_param(arg_is_uid_with_offset))
{
uId -= AUW_IMPULSE_OFFSET;
}
}

if(!forceCheckUid)
{
if(!TrieGetCell(g_tWeaponClcmd, sWeaponName, iWeaponId))
{
return false;
}
}
else
{
if(uId < 0 || uId >= ArraySize(g_aWeaponData))
{
return false;
}
iWeaponId = uId;
}

new bool: notification = true;

notification = bool: get_param(arg_show_notification);

new iBuy = get_param(arg_buy);

return giveItem(iPlayer, iWeaponId, iBuy ? 1 : 0, eAUWGiveItemTypes_Native, notification);
}

public Native_ValidWeapon(iPlugin, iParams)
{
enum { arg_item = 1, arg_uid, arg_is_uid_with_offset };

new iItem = get_param(arg_item);

if(is_nullent(iItem))
{
return false;
}

new iKey = get_param(arg_uid);

if(!get_param(arg_is_uid_with_offset))
{
iKey += AUW_IMPULSE_OFFSET;
}

return bool:(IsCustomWeapon(iItem, iKey));
}

public Native_GetWeaponsData(iPlugin, iParams)
{
enum { arg_uid = 1, arg_array, arg_is_uid_with_offset };

new iKey = get_param(arg_uid);

if(get_param(arg_is_uid_with_offset))
{
iKey -= AUW_IMPULSE_OFFSET;
}

if(!(0 <= iKey < g_iWeaponsCount))
{
return false;
}

new aData[eAUWData];
ArrayGetArray(g_aWeaponData, iKey, aData);

return set_array(arg_array, aData, eAUWData);
}

public client_putinserver(iPlayer)
{
if(is_user_hltv(iPlayer) || is_user_bot(iPlayer))
{
return;
}

set_bit(g_bClientConnected, iPlayer);
}

public client_disconnected(iPlayer)
{
reset_bit(g_bClientConnected, iPlayer);
g_flTouchTime[iPlayer] = 0.0;
}

getClcmdIndex(iIndex)
{
for(new i = 0; i < MAXWEAPONS; i++)
{
if(iIndex == g_iClcmdIndex[i])
{
return i;
}
}

return NULLENT;
}

public Command_GiveWeapon_EX(iPlayer, iAccess, iIndex)
{
new iWeaponId = getClcmdIndex(iIndex);

if(iWeaponId == NULLENT)
{
return PLUGIN_HANDLED;
}

if(g_pCvar[FLAG_ACCESS] && !(get_user_flags(iPlayer) & read_flags(g_pCvar[CMD_ACCESS])))
{
console_print(iPlayer, "%L", iPlayer, "CONSOLE_NO_ACCESS");
return PLUGIN_HANDLED;
}

giveItem(iPlayer, iWeaponId, 1, eAUWGiveItemTypes_PlayerCmd);

return PLUGIN_HANDLED;
}

public Command_GiveWeapon(iPlayer)
{
if(g_pCvar[FLAG_ACCESS] && !(get_user_flags(iPlayer) & read_flags(g_pCvar[CMD_ACCESS])))
{
console_print(iPlayer, "%L", iPlayer, "CONSOLE_NO_ACCESS");
return PLUGIN_HANDLED;
}

new sTarget[64];
new sArg[64];

read_argv(1, sTarget, charsmax(sTarget));
trim(sTarget);
remove_quotes(sTarget);

read_argv(2, sArg, charsmax(sArg));
trim(sArg);
remove_quotes(sArg);

if(sArg[0] == EOS || sTarget[0] == EOS)
{
console_print(iPlayer, "%L", iPlayer, "CONSOLE_USAGE");
return PLUGIN_HANDLED;
}

new iFindPlayer = cmd_target(iPlayer, sTarget, CMDTARGET_ALLOW_SELF)

if(!iFindPlayer)
{
return PLUGIN_HANDLED;
}

if(!get_bit(g_bClientConnected, iFindPlayer))
{
return PLUGIN_HANDLED;
}

new iWeaponId;

if(!TrieGetCell(g_tWeaponClcmd, sArg, iWeaponId))
{
console_print(iPlayer, "%L", iPlayer, "CONSOLE_WEAPONS_NOTFOUND");
return PLUGIN_HANDLED;
}

new aData[eAUWData];

ArrayGetArray(g_aWeaponData, iWeaponId, aData);

if(aData[eAUWData_MENU_WEAPON_ADD] == 0)
{
return PLUGIN_HANDLED;
}

giveItem(iFindPlayer, iWeaponId, 0, eAUWGiveItemTypes_AdminCmd);

return PLUGIN_HANDLED;
}

giveItem(iPlayer, iKey, iBuy, eAUWGiveItemTypes: eGiveItemType, bool: bChatNotification = true)
{
static ret;
ExecuteForward(g_iForwards[eAUWForwards_OnGiveItemPre], ret, eGiveItemType, iPlayer, iKey, iBuy);

if(ret)
{
return 0;
}

new aData[eAUWData];
new iCost;

static iMoney; iMoney = rg_get_user_money(iPlayer);

ArrayGetArray(g_aWeaponData, iKey, aData);

if(iBuy)
{
if(aData[eAUWData_WEAPON_ACCESS_FLAGS] && !(get_user_flags(iPlayer) & aData[eAUWData_WEAPON_ACCESS_FLAGS]))
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_NO_ACCESS");
return 0;
}

if(get_member_game(m_iTotalRoundsPlayed) + 1 < aData[eAUWData_WEAPON_ALLOW_ROUND])
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_ROUNDS", aData[eAUWData_WEAPON_ALLOW_ROUND]);
return 0;
}

new Float: flBuyTime = (get_pcvar_float(g_pCvarBuyTime) * 60) * g_pCvar[BUYTIME];

if(get_gametime() - Float: get_member_game(m_fRoundStartTime) > flBuyTime)
{
client_print(iPlayer, print_center, "%L", iPlayer, "CENTER_BUYTIME", floatround(flBuyTime));
return 0;
}

if(g_pCvar[BUYZONE])
{
if(!rg_get_user_buyzone(iPlayer))
{
client_print(iPlayer, print_center, "%L", iPlayer, "CENTER_NOT_IN_BUYZONE");
return 0;
}
}

if(aData[eAUWData_WEAPON_COST] > 0)
{
iCost = (g_pCvar[DISCOUNT] > 0) ? aData[eAUWData_WEAPON_COST] - getPercentNum(aData[eAUWData_WEAPON_COST], g_pCvar[DISCOUNT]) : aData[eAUWData_WEAPON_COST];

if(iMoney < iCost)
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "СHAT_NO_MONEY");
return 0;
}
}
}

new iWeapon = rg_create_entity(aData[eAUWData_WEAPON_REFERENCE]);

if(is_nullent(iWeapon))
{
return 0;
}

new Float: vecOrigin[3];

get_entvar(iPlayer, var_origin, vecOrigin);
set_entvar(iWeapon, var_origin, vecOrigin);
set_entvar(iWeapon, var_impulse, iKey + AUW_IMPULSE_OFFSET);
setWeaponKey(iWeapon, iKey + AUW_IMPULSE_OFFSET);
setWeaponModelView(iWeapon, aData[eAUWData_WEAPON_MODEL_VIEW]);
setWeaponModelPlayer(iWeapon, aData[eAUWData_WEAPON_MODEL_PLAYER]);
setWeaponModelWorld(iWeapon, aData[eAUWData_WEAPON_MODEL_WORLD]);
setWeaponTrace(iWeapon, aData[eAUWData_WEAPON_TRACE]);
setWeaponFlags(iWeapon, aData[eAUWData_WEAPON_ACCESS_FLAGS]);
set_entvar(iWeapon, var_spawnflags, SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, iWeapon);

if(!aData[eAUWData_WEAPON_SLOT])
{
switch(rg_get_iteminfo(iWeapon, ItemInfo_iSlot))
{
case 0:
{
aData[eAUWData_WEAPON_SLOT] = PRIMARY_WEAPON_SLOT;
}
case 1:
{
aData[eAUWData_WEAPON_SLOT] = PISTOL_SLOT;
}
}

ArraySetArray(g_aWeaponData, iKey, aData);
}

if(aData[eAUWData_WEAPON_ID] != WEAPON_KNIFE)
{
dropWeapons(iPlayer, aData[eAUWData_WEAPON_SLOT]);
}
else
{
rg_remove_item(iPlayer, "weapon_knife");
}

dllfunc(DLLFunc_Touch, iWeapon, iPlayer);

static iOwner; iOwner = get_entvar(iWeapon, var_owner);

if(iOwner != iPlayer || is_nullent(iOwner))
{
if(!is_nullent(iWeapon))
{
engfunc(EngFunc_RemoveEntity, iWeapon);
}
return 0;
}

switch(aData[eAUWData_WEAPON_ID])
{
case WEAPON_KNIFE:
{
set_member(iWeapon, m_Knife_flStabBaseDamage, Float: get_member(iWeapon, m_Knife_flStabBaseDamage) * aData[eAUWData_WEAPON_DAMAGE]);
set_member(iWeapon, m_Knife_flSwingBaseDamage, Float: get_member(iWeapon, m_Knife_flSwingBaseDamage) * aData[eAUWData_WEAPON_DAMAGE]);
set_member(iWeapon, m_Knife_flSwingBaseDamage_Fast, Float: get_member(iWeapon, m_Knife_flSwingBaseDamage_Fast) * aData[eAUWData_WEAPON_DAMAGE]);
}
case WEAPON_M4A1:
{
set_member(iWeapon, m_M4A1_flBaseDamageSil, Float: get_member(iWeapon, m_M4A1_flBaseDamageSil) * aData[eAUWData_WEAPON_DAMAGE]);
}
case WEAPON_USP:
{
set_member(iWeapon, m_USP_flBaseDamageSil, Float: get_member(iWeapon, m_USP_flBaseDamageSil) * aData[eAUWData_WEAPON_DAMAGE]);
}
case WEAPON_FAMAS:
{
set_member(iWeapon, m_Famas_flBaseDamageBurst, Float: get_member(iWeapon, m_Famas_flBaseDamageBurst) * aData[eAUWData_WEAPON_DAMAGE]);
}
}

set_member(iWeapon, m_Weapon_flBaseDamage, Float: get_member(iWeapon, m_Weapon_flBaseDamage) * aData[eAUWData_WEAPON_DAMAGE]);

if(aData[eAUWData_WEAPON_ID] != WEAPON_KNIFE)
{
rg_set_user_ammo(iPlayer, aData[eAUWData_WEAPON_ID], aData[eAUWData_WEAPON_AMMO]);
rg_set_user_bpammo(iPlayer, aData[eAUWData_WEAPON_ID], aData[eAUWData_WEAPON_BPAMMO]);
rg_set_iteminfo(iWeapon, ItemInfo_iMaxClip, aData[eAUWData_WEAPON_AMMO]);
rg_set_iteminfo(iWeapon, ItemInfo_iMaxAmmo1, aData[eAUWData_WEAPON_BPAMMO]);
}

if(iBuy)
{
rg_add_account(iPlayer, iMoney - iCost, AS_SET);
if(bChatNotification)
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_WEAPON_BUY", aData[eAUWData_MENU_NAME_ITEM]);
}
}
else
{
if(bChatNotification)
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_WEAPON_GET", aData[eAUWData_MENU_NAME_ITEM]);
}
}
return 1;
}

public CWeapon_Touch_Pre(iEntity, iPlayer)
{
if(!g_pCvar[PICKUP_ACCESS_TYPE])
{
return HAM_IGNORED;
}

if(is_nullent(iEntity))
{
return HAM_IGNORED;
}

if(!IsPlayer(iPlayer) || !get_bit(g_bClientConnected, iPlayer))
{
return HAM_IGNORED;
}

if(IsCustomWeapon(iEntity, get_entvar(iEntity, var_impulse)))
{
if(getWeaponFlags(iEntity) && !(get_user_flags(iPlayer) & getWeaponFlags(iEntity)))
{
if(g_flTouchTime[iPlayer] > get_gametime())
{
return HAM_SUPERCEDE;
}

client_print(iPlayer, print_center, "%L", iPlayer, "CENTER_NO_ACCESS");
g_flTouchTime[iPlayer] = get_gametime() + 3.0;
return HAM_SUPERCEDE;
}
}

return HAM_IGNORED;
}

public CWeapon_DefaultDeploy_Pre(iItem, sViewModel[], sWeaponModel[], iAnim, sAnimExt[], iSkipLocal)
{
if(is_nullent(iItem))
{
return HC_CONTINUE;
}

if(IsCustomWeapon(iItem, getWeaponKey(iItem)))
{
static sView[64], sPlayer[64];

getWeaponModelView(iItem, sView, sizeof(sView));
getWeaponModelPlayer(iItem, sPlayer, sizeof(sPlayer));
SetHookChainArg(2, ATYPE_STRING, sView);
SetHookChainArg(3, ATYPE_STRING, sPlayer);
}

return HC_CONTINUE;
}

public CWeapon_SetModel_Pre(iEntity, sModel[])
{
if(is_nullent(iEntity))
{
return HC_CONTINUE;
}

new iWeapon = GetWeaponBox(iEntity);

if(is_nullent(iWeapon))
{
return HC_CONTINUE;
}

if(IsCustomWeapon(iWeapon, getWeaponKey(iWeapon)))
{
static sViewModel[64];
getWeaponModelWorld(iWeapon, sViewModel, sizeof(sViewModel));

if(sViewModel[0])
{
SetHookChainArg(2, ATYPE_STRING, sViewModel);
}

setWeaponFlags(iEntity, getWeaponFlags(iWeapon));
set_entvar(iEntity, var_impulse, getWeaponKey(iWeapon));
}

return HC_CONTINUE;
}

GetWeaponBox(iEntity)
{
for(new i = 0, iWeapon; i < MAX_ITEM_TYPES; i++)
{
iWeapon = get_member(iEntity, m_WeaponBox_rgpPlayerItems, i);

if(!is_nullent(iWeapon))
{
return iWeapon;
}
}

return NULLENT;
}

public CWeapon_TraceAttack_Post(iVictim, iAttacker, Float: flDamage, Float: vecDirection[3], iTrace, iBitsDamage)
{
if(!get_bit(g_bClientConnected, iAttacker))
{
return;
}

static iItem; iItem = get_member(iAttacker, m_pActiveItem);

if(is_nullent(iItem))
{
return;
}

new WeaponIdType: iId; iId = get_member(iItem, m_iId);

if(iId == WEAPON_KNIFE)
{
return;
}

if(!IsCustomWeapon(iItem, getWeaponKey(iItem)))
{
return;
}

new Float: vecEndPos[3];
get_tr2(iTrace, TR_vecEndPos, vecEndPos);

if(!getWeaponTrace(iItem))
{
return;
}

if(g_pCvar[TRACE_TYPE])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_BEAMENTPOINT);
write_short(iAttacker | 0x1000);
engfunc(EngFunc_WriteCoord, vecEndPos[0]);
engfunc(EngFunc_WriteCoord, vecEndPos[1]);
engfunc(EngFunc_WriteCoord, vecEndPos[2]);
write_short(g_iLaserBeam);
write_byte(0);
write_byte(0);
write_byte(1);
write_byte(10);
write_byte(0);
write_byte(255); // r
write_byte(215); // g
write_byte(0); //b
write_byte(200); // alpha
write_byte(255);
message_end();
}
else
{
new vecOrigin[3];
get_entvar(iAttacker, var_origin, vecOrigin);

message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(TE_TRACER);
engfunc(EngFunc_WriteCoord, vecOrigin[0]);
engfunc(EngFunc_WriteCoord, vecOrigin[1]);
engfunc(EngFunc_WriteCoord, vecOrigin[2]);
engfunc(EngFunc_WriteCoord, vecEndPos[0]);
engfunc(EngFunc_WriteCoord, vecEndPos[1]);
engfunc(EngFunc_WriteCoord, vecEndPos[2]);
message_end();
}

return;
}

public Command_ShowUltimateMenu(iPlayer)
{
if(g_pCvar[MENU_ACCESS_TYPE] == 0)
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_BUY_DISABLE");
return PLUGIN_HANDLED;
}
else if(g_pCvar[MENU_ACCESS_TYPE] == 2)
{
if(g_pCvar[FLAG_ACCESS] && !(get_user_flags(iPlayer) & read_flags(g_pCvar[FLAG_ACCESS])))
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_NO_ACCESS");
return PLUGIN_HANDLED;
}
}

if(get_member_game(m_iTotalRoundsPlayed) + 1 < g_pCvar[MENU_ROUND])
{
client_print_color(iPlayer, print_team_default, "%L", iPlayer, "CHAT_ROUNDS", g_pCvar[MENU_ROUND]);
return PLUGIN_HANDLED;
}

new sText[128];
new sDiscount[30];
new aData[eAUWData];
new iCost;

formatex(sText, charsmax(sText), "%L", iPlayer, "MENU_TITLE");
new hMenu = menu_create(sText, "ShopMenuHandler");
// maybe add callback?

for(new i = 0; i < g_iWeaponsCount; i++)
{
ArrayGetArray(g_aWeaponData, i, aData);

if(aData[eAUWData_MENU_WEAPON_ADD] == 0 || aData[eAUWData_MENU_WEAPON_ADD] == 2)
{
continue;
}

if(aData[eAUWData_WEAPON_COST] < 0)
{
continue;
}

if(g_pCvar[DISCOUNT] > 0)
{
iCost = aData[eAUWData_WEAPON_COST] - getPercentNum(aData[eAUWData_WEAPON_COST], g_pCvar[DISCOUNT]);

if(getPercentNum(aData[eAUWData_WEAPON_COST], g_pCvar[DISCOUNT]) > 0)
{
formatex(sDiscount, charsmax(sDiscount), "%L", iPlayer, "MENU_DISCOUNT", g_pCvar[DISCOUNT]);
}
}
else
{
iCost = aData[eAUWData_WEAPON_COST];
}

if(g_pCvar[MENU_DAMAGE] > 0)
{
formatex(sText, charsmax(sText), "%s%s %L %s \R\y%d", rg_get_user_money(iPlayer) >= iCost ? "\w" : "\d", aData[eAUWData_MENU_NAME_ITEM], iPlayer, "MENU_DAMAGE", floatround(aData[eAUWData_WEAPON_DAMAGE] * 100), sDiscount, iCost);
}
else
{
formatex(sText, charsmax(sText), "%s%s\R\y%d", rg_get_user_money(iPlayer) >= iCost ? "\w" : "\d", aData[eAUWData_MENU_NAME_ITEM], iCost);
}

menu_additem(hMenu, sText);
}

formatex(sText, charsmax(sText), "%L", iPlayer, "MENU_NEXT");
menu_setprop(hMenu, MPROP_NEXTNAME, sText);
formatex(sText, charsmax(sText), "%L", iPlayer, "MENU_BACK");
menu_setprop(hMenu, MPROP_BACKNAME, sText);
formatex(sText, charsmax(sText), "%L", iPlayer, "MENU_EXIT");
menu_setprop(hMenu, MPROP_EXITNAME, sText);

menu_display(iPlayer, hMenu, 0);

return PLUGIN_HANDLED;
}

public ShopMenuHandler(iPlayer, hMenu, iItem)
{
if(!is_user_alive(iPlayer) || iItem == MENU_EXIT)
{
menu_destroy(hMenu);
return PLUGIN_HANDLED;
}

new sData[6], sName[64], iAccess, iCallback;
menu_item_getinfo(hMenu, iItem, iAccess, sData, charsmax(sData), sName, charsmax(sName), iCallback);

menu_destroy(hMenu);

giveItem(iPlayer, iItem, 1, eAUWGiveItemTypes_ShopMenu);

return PLUGIN_HANDLED;
}

public plugin_precache()
{
g_iLaserBeam = precache_model("sprites/laserbeam.spr");

CFile_Load();
}

CFile_Load()
{
new sPath[128];

get_configsdir(sPath, charsmax(sPath));
format(sPath, charsmax(sPath), "%s/%s", sPath, sFile);

new iFile = fopen(sPath, "rt");

if(!iFile)
{
log_amx("[DEBUG]: No file found ^"%s^".", sPath);
set_fail_state("[DEBUG]: No file found ^"%s^".", sPath);
return;
}

g_iForwards[eAUWForwards_OnParseEnd] = CreateMultiForward("auw_on_parse_end", ET_CONTINUE, FP_CELL);

g_aWeaponData = ArrayCreate(eAUWData);
g_tWeaponClcmd = TrieCreate();

new sLine[512];

new aData[eAUWData];
new sWeaponClcmd[64];
new sWeaponCost[6];
new sWeaponAmmo[4];
new iWeaponBpAmmo[4];
new sWeaponDamage[5];
new sWeaponAllowRound[3];
new sWeaponTrace[3];
new sWeaponMenuAdd[3];
new sWeaponAccessFlag[10];

while(!feof(iFile))
{
fgets(iFile, sLine, charsmax(sLine));
replace(sLine, charsmax(sLine), "^n", "");

if(IsComment(sLine))
{
continue;
}

trim(sLine);

parse(sLine,
aData[eAUWData_WEAPON_REFERENCE], charsmax(aData[eAUWData_WEAPON_REFERENCE]),
sWeaponClcmd, charsmax(sWeaponClcmd),
aData[eAUWData_MENU_NAME_ITEM], charsmax(aData[eAUWData_MENU_NAME_ITEM]),
sWeaponCost, charsmax(sWeaponCost),
sWeaponAmmo, charsmax(sWeaponAmmo),
iWeaponBpAmmo, charsmax(iWeaponBpAmmo),
sWeaponDamage, charsmax(sWeaponDamage),
sWeaponAllowRound, charsmax(sWeaponAllowRound),
sWeaponTrace, charsmax(sWeaponTrace),
sWeaponMenuAdd, charsmax(sWeaponMenuAdd),
sWeaponAccessFlag, charsmax(sWeaponAccessFlag),
aData[eAUWData_WEAPON_MODEL_VIEW], charsmax(aData[eAUWData_WEAPON_MODEL_VIEW]),
aData[eAUWData_WEAPON_MODEL_PLAYER], charsmax(aData[eAUWData_WEAPON_MODEL_PLAYER]),
aData[eAUWData_WEAPON_MODEL_WORLD], charsmax(aData[eAUWData_WEAPON_MODEL_WORLD])
);

if(aData[eAUWData_WEAPON_MODEL_VIEW][0])
{
if(!file_exists(aData[eAUWData_WEAPON_MODEL_VIEW]))
{
set_fail_state("[Error] Model was not found (%s)", aData[eAUWData_WEAPON_MODEL_VIEW]);
}
else
{
precache_model(aData[eAUWData_WEAPON_MODEL_VIEW]);
}
}

if(aData[eAUWData_WEAPON_MODEL_PLAYER][0])
{
if(!file_exists(aData[eAUWData_WEAPON_MODEL_PLAYER]))
{
set_fail_state("[Error] Model was not found (%s)", aData[eAUWData_WEAPON_MODEL_PLAYER]);
}
else
{
precache_model(aData[eAUWData_WEAPON_MODEL_PLAYER]);
}
}

if(aData[eAUWData_WEAPON_MODEL_WORLD][0])
{
if(!file_exists(aData[eAUWData_WEAPON_MODEL_WORLD]))
{
set_fail_state("[Error] Model was not found (%s)", aData[eAUWData_WEAPON_MODEL_WORLD]);
}
else
{
precache_model(aData[eAUWData_WEAPON_MODEL_WORLD]);
}
}

if(!sWeaponAccessFlag[0] || sWeaponAccessFlag[0] == '0') // xd
{
aData[eAUWData_WEAPON_ACCESS_FLAGS] = 0;
}
else
{
aData[eAUWData_WEAPON_ACCESS_FLAGS] = read_flags(sWeaponAccessFlag);
}

aData[eAUWData_WEAPON_ID] = rg_get_weapon_info(aData[eAUWData_WEAPON_REFERENCE], WI_ID);

if(aData[eAUWData_WEAPON_ID] == WEAPON_NONE)
{
log_amx("[Error] Invalid weapon classname (%s)", aData[eAUWData_WEAPON_REFERENCE]);
continue;
}
aData[eAUWData_WEAPON_COST] = str_to_num(sWeaponCost);
aData[eAUWData_WEAPON_AMMO] = str_to_num(sWeaponAmmo);
aData[eAUWData_WEAPON_BPAMMO] = str_to_num(iWeaponBpAmmo);
aData[eAUWData_WEAPON_DAMAGE] = str_to_float(sWeaponDamage);
aData[eAUWData_WEAPON_ALLOW_ROUND] = str_to_num(sWeaponAllowRound);
aData[eAUWData_WEAPON_TRACE] = str_to_num(sWeaponTrace);
aData[eAUWData_MENU_WEAPON_ADD] = str_to_num(sWeaponMenuAdd);

TrieSetCell(g_tWeaponClcmd, sWeaponClcmd, ArrayPushArray(g_aWeaponData, aData));

g_iClcmdIndex[g_iWeaponsCount] = register_clcmd(sWeaponClcmd, "Command_GiveWeapon_EX");
g_iWeaponsCount++;
}

new ret;
ExecuteForward(g_iForwards[eAUWForwards_OnParseEnd], ret, g_iWeaponsCount);

fclose(iFile);
}

public plugin_end()
{
ArrayDestroy(g_aWeaponData);
TrieDestroy(g_tWeaponClcmd);
}

stock bool:rg_get_user_buyzone(const pIndex)
{
new iSignals[UnifiedSignals];

get_member(pIndex, m_signals, iSignals);

return bool:(SignalState:iSignals[US_State] & SIGNAL_BUY);
}

bool: IsCustomWeapon(iItem, iKey)
{
if(0 <= iKey - AUW_IMPULSE_OFFSET < g_iWeaponsCount)
{
if(get_entvar(iItem, var_impulse) == iKey)
{
return true;
}
}

return false;
}

getPercentNum(iNumber, iPercent)
{
return floatround(float(iNumber) * (float(iPercent) / 100.0)); // blya
}

enum
{
APPEND_SLOT = 0,
REMOVE_SLOT = 1,
DROP_SLOT = 2
};

dropWeapons(iPlayer, InventorySlotType: iSlot)
{
if(g_pCvar[GIVE_TYPE] == APPEND_SLOT)
{
return;
}

if(g_pCvar[GIVE_TYPE] == REMOVE_SLOT)
{
rg_remove_items_by_slot(iPlayer, iSlot);
return;
}

static iItem; iItem = get_member(iPlayer, m_rgpPlayerItems, iSlot);

if(is_nullent(iItem))
{
return;
}

static iNext;

do
{
if(!is_nullent(iItem))
{
iNext = get_member(iItem, m_pNext);

switch(g_pCvar[GIVE_TYPE])
{
case DROP_SLOT:
{
rg_drop_items_by_slot(iPlayer, iSlot);
}
}
}
}
while((iItem = iNext) > 0);
}

stateHooks(bool: bState)
{
if(bState)
{
for(new i = 0; i < sizeof(g_pHamHooks[TRACEATTACK]); i++)
{
EnableHamForward(g_pHamHooks[TRACEATTACK][i]);
}

EnableHamForward(g_pHamHooks[TOUCH]);

EnableHookChain(g_pReapiHooks[DEPLOY]);
EnableHookChain(g_pReapiHooks[SETMODEL]);
}
else
{
for(new i = 0; i < sizeof(g_pHamHooks[TRACEATTACK]); i++)
{
DisableHamForward(g_pHamHooks[TRACEATTACK][i]);
}

DisableHamForward(g_pHamHooks[TOUCH]);

DisableHookChain(g_pReapiHooks[DEPLOY]);
DisableHookChain(g_pReapiHooks[SETMODEL]);
}
}
Раньше всё работало, но пришлось по некоторым причинам по новой собрать сборку, и теперь вот такая ошибка
1 Авг 2022
ultimate_weapons_bypass.sma

Код:
#include <amxmodx>
#include <auw>

#define ULTIMATE_DATA_WEAPON_PROXIED 0

public plugin_natives() {
    register_native("weapons_get_weapons_data", "weapons_get_weapons_data");
    register_native("weapons_give_user_ultimate", "weapons_give_user_ultimate");
    register_native("weapons_get_user_ultimate", "weapons_get_user_ultimate");
    register_native("weapons_get_weapon_uid", "weapons_get_weapon_uid");
}

public weapons_get_weapons_data(const plugin, const argc) {
    enum { arg_uid = 1, arg_type, arg_string/* , arg_len  */};
    static szTempString[64];
    get_string(arg_string, szTempString, charsmax(szTempString));

    new uid = get_param(arg_uid), type = get_param(arg_type);

    static aData[eAUWData]; __auw__native__auw_get_weapons_data(uid, aData, false);

    // Only data weapon used in vip rbs
    if(type == ULTIMATE_DATA_WEAPON_PROXIED) {
        return any:aData[eAUWData_WEAPON_ID]; // CSW
    }
    // else if(type == ) {
        
    // }


    return 1;
}

public weapons_give_user_ultimate(const plugin, const argc) {
    enum { arg_player = 1, arg_uid, arg_buyname/* , arg_replace, arg_ammo, arg_bpammo */ };
    new sWeaponName[32];
    get_string(arg_buyname, sWeaponName, charsmax(sWeaponName));

    new id = get_param(arg_player), uid = get_param(arg_uid);
    __auw__native__auw_give_weapon(id, sWeaponName, true, uid, .iUidWithOffset = false, 0);

    return 1;
}

public weapons_get_user_ultimate(const plugin, const argc) {
    enum { /* arg_id = 1, */ arg_ultimates = 2 }; //[32]

    // You should implement it by urself, i don't know how it's work in original ultimate weapons, mostly it's useless
    // Check vip_menu_show cvar
    new arr[32]; arrayset(arr, -1, sizeof(arr));
    set_array(arg_ultimates, arr, 31);
    return 1;
}

public weapons_get_weapon_uid(const plugin, const argc) {
    enum { arg_buyname = 1 };
    new sWeaponName[32];
    get_string(arg_buyname, sWeaponName, charsmax(sWeaponName));

    return __auw__native__auw_get_weapon_uid(sWeaponName, false);
}
 

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

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