Участник
Пользователь
- Сообщения
- 46
- Реакции
- 5
как убрать сияние ?
Код:
#include <amxmodx>
#include <reapi>
#include <engine>
new const g_sEntClassName[] = "classname_kevlar";
public plugin_init() {
register_plugin("AMXX - Death Armor Drop", "1.1b", "Alejandro-.");
RegisterHookChain(RG_CSGameRules_RestartRound, "RG_StartRound", false);
register_touch(g_sEntClassName, "player", "fw_TouchKevlar");
register_event("DeathMsg", "DeathMsg", "a");
}
public RG_StartRound() {
new iEnt = 0;
while((iEnt = rg_find_ent_by_class(iEnt, g_sEntClassName)) > 0) {
remove_entity(iEnt);
}
}
public DeathMsg() {
new index = read_data(1);
new victim = read_data(2);
if (!is_user_connected(index) || !is_user_connected(victim)) return;
new ArmorType:iArmorType;
new iArmor = rg_get_user_armor(victim, iArmorType);
if (iArmorType == ARMOR_NONE) return;
if (!iArmor) return;
static Float:fOrigin[3];
get_entvar(victim, var_origin, fOrigin);
createKevlarWeapon(fOrigin, iArmorType, iArmor);
}
stock createKevlarWeapon(Float:fOrigin[3], ArmorType:iArmorType, iArmor) {
new iEnt = rg_create_entity("armoury_entity");
if(!iEnt) return;
fOrigin[2] -= 36;
set_entvar(iEnt, var_classname, g_sEntClassName);
set_entvar(iEnt, var_origin, fOrigin);
set_entvar(iEnt, var_armorvalue, iArmor);
set_entvar(iEnt, var_armortype, iArmorType);
entity_set_model(iEnt, "models/w_kevlar.mdl");
set_entvar(iEnt, var_solid, SOLID_BBOX);
set_entvar(iEnt, var_movetype, MOVETYPE_FLY);
entity_set_size(iEnt, Float:{ -23.160000, -13.660000, -0.050000 }, Float:{ 11.470000, 12.780000, 6.720000 });
drop_to_floor(iEnt);
rg_set_user_rendering(iEnt, kRenderFxGlowShell, Float:{255.0, 255.0, 255.0}, kRenderFxNone, 27.0);
}
public fw_TouchKevlar(iEnt, index) {
if (!is_user_alive(index)) return PLUGIN_HANDLED;
new ArmorType:iEntArmorType = get_entvar(iEnt, var_armortype);
new iEntArmor = any:get_entvar(iEnt, var_armorvalue);
new iArmor = rg_get_user_armor(index);
if (iArmor >= 100) return PLUGIN_HANDLED;
rg_set_user_armor(index, clamp((iArmor + iEntArmor), 0, 100), iEntArmorType);
client_print(index, print_center, "You Got +%i Armor", iArmor);
remove_entity(iEnt);
return PLUGIN_HANDLED;
}
stock rg_set_user_rendering(const pPlayer, const iFx, const Float:flColor[3] = {0.0, 0.0, 0.0}, const iRender, const Float:flAmount) {
set_entvar(pPlayer, var_renderfx, iFx);
set_entvar(pPlayer, var_rendercolor, flColor);
set_entvar(pPlayer, var_rendermode, iRender);
set_entvar(pPlayer, var_renderamt, flAmount);
}