Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Wklejka 1dl1ktwffhusg dodana przez kakus002, 16.08.2014 10:13
Typ:



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.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <colorchat>
 
#define MAX 32
 
#define x 0
#define y 1
#define z 2
 
new sprite;
new ilosc_blyskawic[33],poprzednia_blyskawica[33];
new const gszSound[] = "LosT_CodMod_Sounds/thunder_clap.wav";
 
new const nazwa[] = "Cheester(161 lv)";
new const opis[] = "Posiada 2 błyskawice(+inteligencja),1/3 z HE,2x Multijump."
new const bronie = 1<<CSW_M4A1 | 1<<CSW_AK47 | 1<<CSW_DEAGLE | 1<<CSW_HEGRENADE;
new const zdrowie = 40;
new const kondycja = 15;
new const inteligencja = 15;
new const wytrzymalosc = 10;
 
new bool:ma_klase[33]
new skoki[33];
 
public plugin_init() 
{
	register_plugin(nazwa, "1.0", "LosT.");
	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
 
	register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
 
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
 
	register_event("ResetHUD", "ResetHUD", "abe");
}
 
public plugin_precache()
{
	sprite = precache_model("sprites/LosT_CodMod_Sprites/lgtning.spr");
	precache_sound(gszSound);
}
 
public cod_class_enabled(id)	
{
	if(cod_get_user_level(id) < 161)
	{
		ColorChat(id, GREEN, "^x01[Menu_Klas] ^x04 [%s]Klasa dostepna od 161 poziomu.", nazwa)
	}
	else 
	{
		ColorChat(id, GREEN, "^x01[Menu_Klas] ^x04 Klasa Stworzona Przez LosT'a.")
		return COD_STOP;
	}
	ilosc_blyskawic[id] = 2;
 
	ma_klase[id] = true;
 
	return COD_CONTINUE;
}
 
public cod_class_disabled(id)
{
	ilosc_blyskawic[id] = 0;
	ma_klase[id] = false;
}
 
public cod_class_skill_used(id) 
{
 
	if(!is_user_alive(id)) return PLUGIN_HANDLED;
 
	if(!ilosc_blyskawic[id]) {
		return PLUGIN_HANDLED;
	}
	new target = Find_Best_Angle(id,600.0,false)
	if (!is_valid_ent(target))
	{
		client_print(id,print_center,"Brak Celu W Zasiegu 600 m")
		return PLUGIN_CONTINUE
	}
	if(is_user_alive(target)){
		if(get_user_team(target) == get_user_team(id)) {
			return PLUGIN_HANDLED;
		}
		if(poprzednia_blyskawica[id]+10.0>get_gametime()) {
			client_print(id,print_chat,"Blyskawicy Mozesz Uzyc Raz Na 10 Sekund");
			return PLUGIN_HANDLED;
		}
		poprzednia_blyskawica[id] = floatround(get_gametime());
		ilosc_blyskawic[id]--;
 
		puscBlyskawice(id, target);
	}
	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, target){
	//Obrazenia
	new ent = create_entity("info_target");
	ExecuteHam(Ham_TakeDamage, target, id, id, 60.0+cod_get_user_intelligence(id)/2, 1);
	remove_entity(ent);
	//Piorun
	Create_TE_BEAMENTS(id, target, sprite, 0, 10, 10, 150, 5, 212, 212, 0, 230, 20);
	//Dzwiek
	emit_sound(id, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	emit_sound(target, CHAN_WEAPON, gszSound, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}
 
public ResetHUD(id) 
{
	if(ma_klase[id]) 
	{	
		ilosc_blyskawic[id] = 2;
	}
}
 
stock Find_Best_Angle(id,Float:dist, same_team = false)
{
	new Float:bestangle = 0.0
	new winner = -1
	for (new i=0; i < MAX; i++)
	{
		if (!is_user_alive(i) || i == id || (get_user_team(i) == get_user_team(id) && !same_team))
			continue
		if (get_user_team(i) != get_user_team(id) && same_team)
			continue
		//User has spell immunity, don't target
		new Float:c_angle = Find_Angle(id,i,dist)
		if (c_angle > bestangle && Can_Trace_Line(id,i))
		{
			winner = i
			bestangle = c_angle
		}
	}
	return winner
}
 
stock Float:Find_Angle(Core,Target,Float:dist)
{
	new Float:vec2LOS[2]
	new Float:flDot
	new Float:CoreOrigin[3]
	new Float:TargetOrigin[3]
	new Float:CoreAngles[3]
	pev(Core,pev_origin,CoreOrigin)
	pev(Target,pev_origin,TargetOrigin)
	if (get_distance_f(CoreOrigin,TargetOrigin) > dist)
		return 0.0
	pev(Core,pev_angles, CoreAngles)
	for ( new i = 0; i < 2; i++ )
		vec2LOS[i] = TargetOrigin[i] - CoreOrigin[i]
	new Float:veclength = Vec2DLength(vec2LOS)
	//Normalize V2LOS
	if (veclength <= 0.0)
	{
		vec2LOS[x] = 0.0
		vec2LOS[y] = 0.0
	}
	else
	{
		new Float:flLen = 1.0 / veclength;
		vec2LOS[x] = vec2LOS[x]*flLen
		vec2LOS[y] = vec2LOS[y]*flLen
	}
	//Do a makevector to make v_forward right
	engfunc(EngFunc_MakeVectors,CoreAngles)
	new Float:v_forward[3]
	new Float:v_forward2D[2]
	get_global_vector(GL_v_forward, v_forward)
	v_forward2D[x] = v_forward[x]
	v_forward2D[y] = v_forward[y]
	flDot = vec2LOS[x]*v_forward2D[x]+vec2LOS[y]*v_forward2D[y]
	if ( flDot > 0.5 )
	{
		return flDot
	}
	return 0.0	
}
 
stock Float:Vec2DLength( Float:Vec[2] )
{
	return floatsqroot(Vec[x]*Vec[x] + Vec[y]*Vec[y] )
}
 
stock bool:Can_Trace_Line(id, target)
{	
	for (new i=-35; i < 60; i+=35)
	{	
		new Float:Origin_Id[3]
		new Float:Origin_Target[3]
		new Float:Origin_Return[3]
		pev(id,pev_origin,Origin_Id)
		pev(target,pev_origin,Origin_Target)
		Origin_Id[z] = Origin_Id[z] + i
		Origin_Target[z] = Origin_Target[z] + i
		trace_line(-1, Origin_Id, Origin_Target, Origin_Return)
		if (get_distance_f(Origin_Return,Origin_Target) < 25.0)
			return true
	}
	return false
}
 
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] = 2;
 
	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_HEGRENADE && 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;
}
 
 

Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011