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. | /* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <engine>
#include <codmod>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "DarkGL"
new bool:ma_klase[33];
new const nazwa[] = "[Pudzian";
new const opis[] = "Moze odbijac sie od scian";
new const bronie = 1<<CSW_M249 | 1<<CSW_DEAGLE;
new const zdrowie = 20;
new const kondycja = -30;
new const inteligencja = 0;
new const wytrzymalosc = 20;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack")
}
public cod_class_enabled(id)
ma_klase[id] = true;
public cod_class_disabled(id)
ma_klase[id] = false;
stock get_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed, Float:fVelocity[3] )
{
new Float:fEntOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fEntOrigin );
// Velocity = Distance / Time
new Float:fDistance[3];
fDistance[0] = fEntOrigin[0] - fOrigin[0];
fDistance[1] = fEntOrigin[1] - fOrigin[1];
fDistance[2] = fEntOrigin[2] - fOrigin[2];
new Float:fTime = ( vector_distance( fEntOrigin,fOrigin ) / fSpeed );
fVelocity[0] = fDistance[0] / fTime;
fVelocity[1] = fDistance[1] / fTime;
fVelocity[2] = fDistance[2] / fTime;
return ( fVelocity[0] && fVelocity[1] && fVelocity[2] );
}
// Sets velocity of an entity (ent) away from origin with speed (speed)
stock set_velocity_from_origin( ent, Float:fOrigin[3], Float:fSpeed )
{
new Float:fVelocity[3];
get_velocity_from_origin( ent, fOrigin, fSpeed, fVelocity )
entity_set_vector( ent, EV_VEC_velocity, fVelocity );
return ( 1 );
}
public fw_TraceAttack(id, enemy, Float:damage, Float:direction[3], tracehandle, damagetype){
if (!is_user_alive(enemy) || !ma_klase[enemy] || get_user_weapon(enemy) != CSW_KNIFE){
return HAM_IGNORED
}
get_tr2(tracehandle,TR_vecEndPos,direction);
set_velocity_from_origin(enemy,direction,500.0);
return HAM_IGNORED
}
|