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.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150. | #include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#define DMG_BULLET (1<<1)
new sprite;
new ilosc_blyskawic[33],poprzednia_blyskawica[33];
new bool:ma_klase[33];
new skoki[33];
new const nazwa[] = "Flasher (Premium)";
new const opis[] = "Ma 100 dodatkowych dmg, 4 blyskawice (Uzycie: klawisz E), ma podwojny skok oraz dodatkowe 50 hp i pelen magazynek za kazde zabojstwo.";
new const bronie = (1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_HEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_SMOKEGRENADE);
new const zdrowie = 100;
new const kondycja = 100;
new const inteligencja = 100;
new const wytrzymalosc = 100;
public plugin_init()
{
register_plugin(nazwa, "1.0", "tQQ");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
register_event("ResetHUD", "ResetHUD", "abe");
}
public plugin_precache()
{
sprite = precache_model("sprites/lgtning.spr");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_B))
{
client_print(id, print_chat, "[Flasher (Premium)] Klasa by tQQ. Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
ma_klase[id] = true;
ilosc_blyskawic[id] = 2;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
ilosc_blyskawic[id] = 0;
}
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 1;
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_M4A1)
cod_inflict_damage(idattacker, this, 100.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}
public cod_class_skill_used(id) {
if(!is_user_alive(id)) return PLUGIN_HANDLED;
if(!ilosc_blyskawic[id]) {
return PLUGIN_HANDLED;
}
new ofiara, body;
get_user_aiming(id, ofiara, body);
if(is_user_alive(ofiara)){
if(get_user_team(ofiara) == get_user_team(id)) {
return PLUGIN_HANDLED;
}
if(poprzednia_blyskawica[id]+5.0>get_gametime()) {
client_print(id,print_chat,"Blyskawicy mozesz uzyc raz na 5 sek.");
return PLUGIN_HANDLED;
}
poprzednia_blyskawica[id] = floatround(get_gametime());
ilosc_blyskawic[id]--;
puscBlyskawice(id, ofiara, 50.0, 0.5);
}
return PLUGIN_HANDLED;
}
stock Create_TE_BEAMENTS(startEntity, endEntity, iSprite, startFrame, frameRate, life, width, noise, red, green, blue, alpha, speed) {
message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( TE_BEAMENTS )
write_short( startEntity ) // start entity
write_short( endEntity ) // end entity
write_short( iSprite ) // model
write_byte( startFrame ) // starting frame
write_byte( frameRate ) // frame rate
write_byte( life ) // life
write_byte( width ) // line width
write_byte( noise ) // noise amplitude
write_byte( red ) // red
write_byte( green ) // green
write_byte( blue ) // blue
write_byte( alpha ) // brightness
write_byte( speed ) // scroll speed
message_end()
}
puscBlyskawice(id, ofiara, Float:fObrazenia = 55.0, Float:fCzas = 1.0){
//Obrazenia
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "blyskawica");
cod_inflict_damage(id, ofiara, fObrazenia, 1.0, ent, DMG_SHOCK);
remove_entity(ent);
//Piorun
Create_TE_BEAMENTS(id, ofiara, sprite, 0, 10, floatround(fCzas*10), 150, 5, 200, 200, 200, 200, 10);
}
public ResetHUD(id) {
if(ma_klase[id] == true) {
ilosc_blyskawic[id] = 4;
}
} |