pododawaj to gdzie trzeba
niemam frakcji wiec ci gotowca nie zrobie
#include <amxmodx>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#define DMG_BULLET (1<<1)
new const nazwa[] = "Snajper";
new const opis[] = "Ma 1/2 z AWP";
new const bronie = 1<<CSW_AWP | 1<<CSW_DEAGLE;
new const zdrowie = 35;
new const kondycja = 25;
new const inteligencja = 5;
new const wytrzymalosc = 10;
new bool:ma_klase[33];
public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_AWP && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
if(weapon == CSW_AWP && damage > 20.0 && random_num(1,2) == 1)
w tej linijce zmieniasz bron CSW_AWP i szanse na zabicie random_num(1,2) == 1)
np.1/3 z m4
if(weapon == CSW_M4A1 && damage > 20.0 && random_num(1,3) == 1)
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_AWP && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_M4A1 && damage > 20.0 && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
ja bym to tak zrobil ale niewiem czy dobrze , nie testowane
Użytkownik Kmf!p edytował ten post 27.02.2012 23:06