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 138696431928331 dodana przez k4x4z5, 13.12.2013 20:51
Typ:


138696431928331
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.
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>
#include <cstrike>
#include <fun>
 
 
new Float:origin[33][3]
new prethink_counter[33]
new bool:is_drawing[33]
new bool:is_holding[33]
 
new spriteid
 
public plugin_init()
{
	register_plugin("Marker Jailbreak", "1.0", "stupok69")
	register_clcmd("+paint", "paint_handler", 0, "Paint on the walls!")
	register_clcmd("-paint", "paint_handler", 0, "Paint on the walls!")
	register_forward(FM_PlayerPreThink, "forward_FM_PlayerPreThink", 0)
}
 
public plugin_precache(){
	spriteid = precache_model("sprites/lgtning.spr")
}
 
public paint_handler(id)
{
	if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT){
 
		if(!is_user_alive(id)) return 1
 
		static cmd[2]
		read_argv(0, cmd, 1)
 
		switch(cmd[0])
		{
			case '+': is_drawing[id] = true
				case '-': is_drawing[id] = false
			}
	}
	return 1
}
 
public forward_FM_PlayerPreThink(id)
{
	if(prethink_counter[id]++ > 5)
	{
		if(is_drawing[id] && !is_aiming_at_sky(id))
		{
			static Float:cur_origin[3], Float:distance
 
			cur_origin = origin[id]
 
			if(!is_holding[id])
			{
				fm_get_aim_origin(id, origin[id])
				move_toward_client(id, origin[id])
				is_holding[id] = true
				return FMRES_IGNORED
			}
 
			fm_get_aim_origin(id, origin[id])
			move_toward_client(id, origin[id])
 
			distance = get_distance_f(origin[id], cur_origin)
 
			if(distance > 2)
			{
				draw_line(origin[id], cur_origin)
			}
		}
		else
		{
			is_holding[id] = false
		}
		prethink_counter[id] = 0
	}
	return FMRES_IGNORED
}
 
stock draw_line(Float:origin1[3], Float:origin2[3])
{
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
	write_byte(TE_BEAMPOINTS)
	engfunc(EngFunc_WriteCoord, origin1[0])
	engfunc(EngFunc_WriteCoord, origin1[1])
	engfunc(EngFunc_WriteCoord, origin1[2])
	engfunc(EngFunc_WriteCoord, origin2[0])
	engfunc(EngFunc_WriteCoord, origin2[1])
	engfunc(EngFunc_WriteCoord, origin2[2])
	write_short(spriteid)
	write_byte(0)
	write_byte(10)
	write_byte(255)
	write_byte(50)
	write_byte(0)
	write_byte(random(255))
	write_byte(random(255))
	write_byte(random(255))
	write_byte(255)
	write_byte(0)
	message_end()
}
 
//from fakemeta_util.inc
stock fm_get_aim_origin(index, Float:origin[3])
{
	static Float:start[3], Float:view_ofs[3]
	pev(index, pev_origin, start)
	pev(index, pev_view_ofs, view_ofs)
	xs_vec_add(start, view_ofs, start)
 
	static Float:dest[3]
	pev(index, pev_v_angle, dest)
	engfunc(EngFunc_MakeVectors, dest)
	global_get(glb_v_forward, dest)
	xs_vec_mul_scalar(dest, 9999.0, dest)
	xs_vec_add(start, dest, dest)
 
	engfunc(EngFunc_TraceLine, start, dest, 0, index, 0)
	get_tr2(0, TR_vecEndPos, origin)
 
	return 1
}
 
stock move_toward_client(id, Float:origin[3])
{               
	static Float:player_origin[3]
 
	pev(id, pev_origin, player_origin)
 
	origin[0] += (player_origin[0] > origin[0]) ? 1.0 : -1.0
	origin[1] += (player_origin[1] > origin[1]) ? 1.0 : -1.0
	origin[2] += (player_origin[2] > origin[2]) ? 1.0 : -1.0
}
//Thanks Alka!
stock bool:is_aiming_at_sky(index)
{
	static target, temp
 
	get_user_aiming(index, target, temp)
 
	if(engfunc(EngFunc_PointContents,target) == CONTENTS_SKY)
		return true
 
	return false
}