Участник
Пользователь
- Сообщения
- 486
- Реакции
- 88
- Помог
- 5 раз(а)
Код:
#include <amxmodx>
#include <reapi>
#include <weapon_skin_system>
#define PLUGIN "Weapon Skin System: Addon AK-47 Gold"
#define VERSION "0.1"
#define AUTHOR "Mistrick"
#pragma semicolon 1
#define WSS_ACCESS_FLAG (ADMIN_BAN|ADMIN_LEVEL_H)
enum SkinInfo {SkinIndex, SkinWeaponid};
enum Skins {SKIN_AK};
new g_iWeaponSkins[Skins][SkinInfo];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage_Pre");
}
public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
{
new weapon = get_member(pevAttacker, m_pActiveItem);
if(wss_get_weapon_skin_index(weapon) == g_iWeaponSkins[SKIN_AK][SkinIndex])
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 20.2);
}
}
public wss_loaded_skin(id, index, weaponid, name[])
{
if(equal(name, "Gold AK-47"))
{
g_iWeaponSkins[SKIN_AK][SkinIndex] = index;
g_iWeaponSkins[SKIN_AK][SkinWeaponid] = weaponid;
}
}
public wss_weapon_can_pickup(id, weaponbox, weapon, weaponid, skin)
{
if (wss_get_weapon_skin_index(weapon) == g_iWeaponSkins[SKIN_AK][SkinIndex])
{
return (get_user_flags(id) & WSS_ACCESS_FLAG) ? WEAPON_CAN_PICKUP : WEAPON_BLOCK_PICKUP;
}
return WEAPON_CAN_PICKUP;
}
Код:
rg_set_user_ammo(id, weapon, 45);
rg_set_user_bpammo(id, weapon, 135);