1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94. | /* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <codmod>
new bool:ma_klase[33];
new const nazwa[] = "Dres";
new const opis[] = "Odporny na head shoty, posiada kastet i 1/1 z niego. ";
new const bronie = 1<<CSW_ELITE;
new const zdrowie = 0;
new const kondycja = 50;
new const inteligencja = 0;
new const wytrzymalosc = 150;
public plugin_precache()
{
precache_model("models/dres/v_knife.mdl");
}
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_forward(FM_TraceLine, "TraceLine");
register_event("CurWeapon", "CurWeapon", "be", "1=1")
}
public cod_class_enabled(id)
{
ma_klase[id] = true;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public TraceLine(Float:start[3], Float:end[3], conditions, id, trace)
{
if(get_tr2(trace, TR_iHitgroup) != HIT_HEAD)
return FMRES_IGNORED;
new iHit = get_tr2(trace, TR_pHit);
if(!is_user_connected(iHit))
return FMRES_IGNORED;
if(!ma_klase[iHit])
return FMRES_IGNORED;
set_tr2(trace, TR_iHitgroup, 8);
return FMRES_IGNORED;
}
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_KNIFE && 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;
}
public CurWeapon(id)
{
new weapon = read_data(2);
if(ma_klase[id])
{
if(weapon == CSW_KNIFE)
{
set_pev(id, pev_viewmodel2, "models/dres/v_knife.mdl")
}
}
} |