/*
* Hook API function that are available into enum.
* Look at the enums for parameter lists.
*
* @param function The function to hook
* @param callback The forward to call
* @param post Whether or not to forward this in post
*
* @return Returns a hook handle. Use EnableHookChain/DisableHookChain to toggle the forward on or off
*/
native HookChain:RegisterHookChain({EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, GamedllFunc_CGrenade, GamedllFunc_CWeaponBox, ReCheckerFunc, GamedllFunc_CBasePlayerWeapon}:function_id, const callback[], post = 0);
Для работы с энтити weaponbox (поцепить модельку на неё, закинуть в неё патроны и т.п.)информации про RG_CWeaponBox_SetModel вообще не нашел
reapiКстати из какого include ты взял
native HookChain:RegisterHookChain({EngineFunc, GamedllFunc, GamedllFunc_CBaseAnimating, GamedllFunc_CBasePlayer, GamedllFunc_CSGameRules, GamedllFunc_CGrenade, GamedllFunc_CWeaponBox, ReCheckerFunc, GamedllFunc_CBasePlayerWeapon}:function_id, const callback[], post = 0);
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fakemeta>
#include <hamsandwich>
#include <ham_const>
#include <fun>
#define PLUGIN "[The useful functions] ham_strip_weapon"
#define VERSION "1.0"
#define AUTHOR "Admin"
new weaponnum[19] = {
3, 5, 7, 8, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 24, 27, 28, 29, 30
};
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say strip","un_weapon");
}
public un_weapon(id){
//Получение id оружия
new pl_weapon = get_user_weapon(id)
for(new i = 0; i < 19; i++)
{
if(weaponnum[i] == pl_weapon)
{
new weapon_name[24]
//Получение названия оружия
get_weaponname(pl_weapon,weapon_name,24)
client_print_color(id, Red, "Это оружие называется - %s", weapon_name);
//Вызов функции
ham_strip_weapon(id,weapon_name)
}
else
{
give_item(id, "weapon_m4a1"); //Выдаём пистолет p228
ExecuteHam(Ham_GiveAmmo, id, 90, "556nato", 92);
}
}
return PLUGIN_HANDLED_MAIN;
}
stock ham_strip_weapon(id,weapon[])
{
if(!equal(weapon,"weapon_",7)) return 0
new wId = get_weaponid(weapon)
if(!wId) return 0
new wEnt
while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
if(!wEnt) return 0
if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt)
if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0
ExecuteHamB(Ham_Item_Kill,wEnt);
set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId))
give_item(id, "weapon_m4a1"); //Выдаём пистолет p228
ExecuteHam(Ham_GiveAmmo, id, 90, "556nato", 92);
return 1
}
#include <amxmodx>
#include <colorchat>
#include <reapi>
#define PLUGIN "[The useful functions] ham_strip_weapon"
#define VERSION "1.0"
#define AUTHOR "Admin"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say strip","un_weapon");
}
public un_weapon(id){
rg_give_item(id, "weapon_m4a1", GT_REPLACE);
rg_set_user_bpammo(id, WEAPON_M4A1, 90);
}
/*
* Last update: 09.02.2019
*
* Original code by F@nt0M: https://dev-cs.ru/threads/1983/page-3#post-51426
*/
#include <amxmodx>
#include <hamsandwich>
#include <reapi>
#pragma semicolon 1
new const PLUGIN_VERSION[] = "1.0";
/****************************************************************************************
****************************************************************************************/
#define IsUserValid(%0) (1 <= %0 <= MaxClients)
#define GetCvarDesc(%0) fmt("%l", %0)
// Режим DEBUG. Раскомментировать если нужно включить команду для выдачи оружия
//#define DEBUG
// Уникальный ID (impulse) для оружия
#define WEAPON_UID 130
// ID оружия (берётся из файла cssdk_const.inc из enum WeaponIdType)
#define WEAPON_ID WEAPON_AK47
// Получить ID оружия
#define GetWeaponID(%0) WeaponIdType:get_member(%0, m_iId)
// Является ли оружие нашим кастомным
#define IsCustomWeapon(%0) bool:(get_entvar(%0, var_impulse) == WEAPON_UID)
// Нужны ли модели
#define MODELS
// Нужна ли модель "w_"
//#define MODEL_W