/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <codmod>
#define DMG_BULLET (1<<1)
new const perk_name[] = "Test";
new const perk_desc[] = "to testowy perk";
new bool:ma_perk[33];
public plugin_init()
{
register_plugin(perk_name, "1.0", "System");
cod_register_perk(perk_name, perk_desc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_perk_enabled(id)
{
cod_give_weapon(id, CSW_HEGRENADE);
ma_perk[id] = true;
}
public cod_perk_disabled(id)
{
cod_take_weapon(id, CSW_HEGRENADE);
ma_perk[id] = false;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_perk[idattacker])
return HAM_IGNORED;
if(random(1.3))
return HAM_IGNORED;
if(get_user_team(this) == get_user_team(idattacker))
return HAM_IGNORED;
if(get_user_weapon(idattacker) != CSW_HEGRENADE)
return HAM_IGNORED;
if(!(damagebits & DMG_BULLET))
return HAM_IGNORED;
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
Dałem szanse na 1/1.3, ale przy kompilacji wybija warning
[error]Warning: Tag mismatch on line 43[/error]
a w grze 75% nie działa.
da się to jakoś zrobić?
Użytkownik metfiu edytował ten post 31.12.2011 21:23