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 87appshsl2w dodana przez Stachuu :D ??, 23.12.2012 19:03
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.
public check_wsparcie()
{
	new Players[32], playerCount, a
	get_players(Players, playerCount, "ah")
 
	for (new i=0; i<playerCount; i++)
	{
		a = Players[i]
		if (wsparcie[n_g[a]][0]!=1)
			continue
 
		Predator_Goggles(a)
	}
}
new tablica[33][33]
stock zwroc_kogo(id)
{
	new Players[32], playerCount, s
	get_players(Players, playerCount, "a") 
	new id2
	for (new f=0; f<playerCount; f++) 
	{
		s = Players[f] 
		if(s == id) continue;
		if(n_g[id] != n_g[s]) continue;
		if(!is_user_alive(s))continue;
		if(get_user_team(id) != get_user_team(s)) continue;
 
		new id2 = s
		for (new f=0; f<playerCount; f++) 
		{
			s = Players[f] 
 
			if(s == id) continue;
			if(n_g[id] == n_g[s]) continue;
			if(player_class[s]==Ninja)continue;
			if(get_user_team(id) == get_user_team(s)) continue;
			if(fm_is_ent_visible(id2,s)){
				tablica[id][s]=1
			}
		}
	}
}
public Predator_Goggles(id)
{
	zwroc_kogo(id)
 
	new Float:my_origin[3] 
	entity_get_vector(id, EV_VEC_origin, my_origin)
	new s
 
	for (new i=0; i<32; i++) 
	{
		if(!tablica[id][i])continue;
 
		s = i 
 
		if(fm_is_ent_visible(id,i))
			continue;
 
		new Float:target_origin[3]
		// get origin of target
		entity_get_vector(s,EV_VEC_origin,target_origin)
 
		new Float:distance=vector_distance(my_origin,target_origin)
 
		// get vector from me to target
		new Float:v_middle[3]
		subVec(target_origin,my_origin,v_middle)
 
		// trace from me to target, getting hitpoint
		new Float:v_hitpoint[3]
		trace_line (-1,my_origin,target_origin,v_hitpoint)
 
		// get distance from me to hitpoint (nearest wall)
		new Float:distance_to_hitpoint=vector_distance(my_origin,v_hitpoint)
 
		// scale
		new Float:scaled_bone_len
 
		scaled_bone_len=distance_to_hitpoint/distance*50.0
 
		new Float:scaled_bone_width=distance_to_hitpoint/distance*150.0
 
		new Float:v_bone_start[3],Float:v_bone_end[3]
		new Float:offset_vector[3]
 
		// get the point 10.0 units away from wall
		normalize(v_middle,offset_vector,distance_to_hitpoint-10.0) // offset from wall
 
		// set to eye level
		new Float:eye_level[3]
		copyVec(my_origin,eye_level)
 
		eye_level[2]+=17.5
 
		addVec(offset_vector,eye_level)
 
		// start and end of green box
		copyVec(offset_vector,v_bone_start)
		copyVec(offset_vector,v_bone_end)
		v_bone_end[2]-=scaled_bone_len
 
		new Float:distance_target_hitpoint=distance-distance_to_hitpoint
 
		new actual_bright=255
 
		if (distance_target_hitpoint<640.0){
			actual_bright=(255-floatround(distance_target_hitpoint/12.0))
 
			}else{
			actual_bright=85
		}
 
		make_TE_BEAMPOINTS(id,v_bone_start,v_bone_end,floatround(scaled_bone_width),actual_bright)
 
		tablica[id][s] = 0
 
	}
	return PLUGIN_CONTINUE
 
}
 
public make_TE_BEAMPOINTS(id,Float:Vec1[3],Float:Vec2[3],width,brightness){
	message_begin(MSG_ONE_UNRELIABLE ,SVC_TEMPENTITY,{0,0,0},id) //message begin
	write_byte(0)
	write_coord(floatround(Vec1[0])) // start position
	write_coord(floatround(Vec1[1]))
	write_coord(floatround(Vec1[2]))
	write_coord(floatround(Vec2[0])) // end position
	write_coord(floatround(Vec2[1]))
	write_coord(floatround(Vec2[2]))
	write_short(laser) // sprite index
	write_byte(3) // starting frame
	write_byte(0) // frame rate in 0.1's
	write_byte(floatround(0.2*10)) // life in 0.1's
	write_byte(width) // line width in 0.1's
	write_byte(0) // noise amplitude in 0.01's
	write_byte(0)
	write_byte(255)
	write_byte(0)
	write_byte(brightness) // brightness)
	write_byte(0) // scroll speed in 0.1's
	message_end()
}
public copyVec(Float:Vec[3],Float:Ret[3]){
	Ret[0]=Vec[0]
	Ret[1]=Vec[1]
	Ret[2]=Vec[2]
}
 
public subVec(Float:Vec1[3],Float:Vec2[3],Float:Ret[3]){
	Ret[0]=Vec1[0]-Vec2[0]
	Ret[1]=Vec1[1]-Vec2[1]
	Ret[2]=Vec1[2]-Vec2[2]
}
 
public addVec(Float:Vec1[3],Float:Vec2[3]){
	Vec1[0]+=Vec2[0]
	Vec1[1]+=Vec2[1]
	Vec1[2]+=Vec2[2]
}
stock normalize(Float:fIn[3], Float:fOut[3], Float:fMul)
{
	new Float:fLen = xs_vec_len(fIn)
	xs_vec_copy(fIn, fOut)
 
	fOut[0] /= fLen, fOut[1] /= fLen, fOut[2] /= fLen
	fOut[0] *= fMul, fOut[1] *= fMul, fOut[2] *= fMul
}

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