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 2lpb9je0jn8k dodana przez MarcineN, 21.11.2012 22:29
Typ:



chowany
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.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <engine>
#include <colorchat>
#include <jailbreak>
 
#define PLUGIN "[JB] Chowany"
#define VERSION "1.1"
#define AUTHOR "Cypis"
 
new bool:g_ChoosenColor[MAX+1], fPlayerPreThink, fCmdStart, ilosc;
 
new const g_FlashlightColors[][3] = { 
	{255,0,0},//czerwony
	{0,255,0},//zielony
	{0,0,255},//niebieski
	{255,69,0},//pomaranczowy
	{0,255,255},//aqua
	{255,255,0},//zolty
	{255,0,255},//rozowy
	{255,255,255}//bialy
};
 
new const g_FlashlightColorNames[][] = { 
	"Czerwonym",
	"Zielonym",
	"Niebieskim",
	"Pomaranczowym",
	"Aqua",
	"Zoltym",
	"Rozowym",
	"Bialy ratuje!"
};
new bool:g_HasFlashOn[MAX+1], g_FlashColor[MAX+1];
 
new id_zabawa;
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
 
	id_zabawa = jail_register_game("Chowany");
        register_clcmd("say /chowany","Chowany");
}
 
public OnLastPrisonerShowWish(id)
{
	if(OnRemoveData()){
		set_user_maxspeed(id, 250.0);
	}
}
 
public OnRemoveData()
{
	if(fPlayerPreThink || fCmdStart)
	{
		RegisterChowany(false);
		set_lights("#OFF");
		ilosc = 0;
		return 1;
	}
	ilosc = 0;
	return 0;
}
 
public OnDayStartPre(day, szInfo[256], szInfo2[512], setting[10], gTimeRound)
{	
	static szTime[12];
	if(day == id_zabawa)
	{
		format_time(szTime, 11, "%M:%S", gTimeRound-60);		
		formatex(szInfo2, 511, "Zasady:^n%s - Wiezniowie maja czas na schowanie sie^n%s - Straznicy zaczynaja szukac^nOstatni wiezien ma zyczenie", szTime, szTime);
		szInfo = "Dzisiaj jest Chowany";
 
		jail_set_prisoners_micro(true, true);
		jail_set_ct_hit_tt(true);
		jail_set_god_ct(true);
 
		setting[0] = 1;
		setting[1] = 1;
		setting[2] = 1;
		setting[4] = 1;
		setting[7] = 2;
	}
}
 
public OnDayStartPost(day)
{
	if(day == id_zabawa)
	{
		jail_open_cele();
		jail_set_game_hud(60, "Rozpoczecie zabawy za");
 
		RegisterChowany(true);
	}
}
 
public OnGameHudEnd()
{
	static day;
	day = jail_get_play_game_id();
	if(day == id_zabawa)
	{
		if(!ilosc)
		{
			set_lights("a");
			jail_set_ct_hit_tt(false);
			jail_set_game_hud(300, "Zakonczenie zabawy za");
		}
		else
		{
			jail_set_play_game(USUWANIE_DANYCH, true);
			set_lights("#OFF");	
 
			RegisterChowany(false);
 
			for(new i=1; i<=32; i++)
			{
				g_ChoosenColor[i] = false;
				if(is_user_alive(i) && is_user_connected(i))			
					set_user_maxspeed(i, 250.0);
			}
		}
		ilosc++;
	}
}
 
//
RegisterChowany(bool:wartosc)
{
	if(wartosc)
	{
		if(!fPlayerPreThink)
			fPlayerPreThink = register_forward(FM_PlayerPreThink, "PreThink");
 
		if(!fCmdStart)
			fCmdStart = register_forward(FM_CmdStart, "fwCmdStart");
	}
	else
	{
		if(fPlayerPreThink)
		{
			unregister_forward(FM_PlayerPreThink, fPlayerPreThink);
			fPlayerPreThink = 0;
		}
		if(fCmdStart)
		{
			unregister_forward(FM_CmdStart, fCmdStart);
			fCmdStart = 0;
		}
	}
}
 
public showColorMenu(id)
{
	new menu = menu_create("yZostales znaleziony! Wybierz nastepny kolor latarki!^nMaszw 5y sekund", "Handel_Kolor");
 
	menu_additem(menu, "Czerwony");
	menu_additem(menu, "Zielony");
	menu_additem(menu, "Niebieski");
	menu_additem(menu, "Pomaranczowy");
	menu_additem(menu, "Aqua");
	menu_additem(menu, "Zolty");
	menu_additem(menu, "Rozowy");
 
	menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
	menu_display(id, menu);
}
 
public Handel_Kolor(id, menu, item)
{
	if(item == MENU_EXIT || get_user_team(id) != 1 || !is_user_alive(id))
		return;
 
	new szColor[32], szName[32], acces, callback, data[2];
	get_user_name(id, szName, 31);
	menu_item_getinfo(menu, item, acces, data, 1, szColor, 31, callback);
 
	set_user_rendering(id, kRenderFxGlowShell, g_FlashlightColors[item][0], g_FlashlightColors[item][1], g_FlashlightColors[item][2], kRenderNormal, 1);
	ColorChat(0, TEAM_COLOR, "^x04[Chowany]^x03 %s^x01 wybral kolor^x03 %s", szName, szColor);
 
	SprwaczCzyOstatni();
}
 
SprwaczCzyOstatni()
{
	new bool:koniec = false;
	for(new i=1; i<=MAX; i++)
	{
		if(!is_user_connected(i) || !is_user_alive(i) || get_user_team(i) != 1)
			continue;
 
		koniec = true;
		if(!g_ChoosenColor[i])
		{
			koniec = false;
			break;
		}
	}
	if(koniec)
	{
		jail_remove_game_hud();
		jail_set_play_game(USUWANIE_DANYCH, true);
 
		set_lights("#OFF");	
 
		RegisterChowany(false);
 
		for(new i=1; i<=MAX; i++)
		{
			g_ChoosenColor[i] = false;
			if(is_user_alive(i) && is_user_connected(i))			
				set_user_maxspeed(i, 250.0);
		}
	}
}
 
public fwCmdStart(id, uc)
{
	if(!is_user_alive(id) || get_user_team(id) != 2) 
		return FMRES_HANDLED;
 
	if(get_uc(uc, UC_Buttons) & IN_USE && !(pev(id, pev_oldbuttons) & IN_USE))
	{
		new id2, body;
		get_user_aiming(id, id2, body);
 
		if(is_user_connected(id2) && is_user_alive(id2) && get_user_team(id2) == 1)
		{
			if(!g_ChoosenColor[id2])
			{
				new szName[2][32];
				get_user_name(id, szName[0], 31);
				get_user_name(id2, szName[1], 31);
 
				client_cmd(id, "spk fvox/blip");
				client_cmd(id2, "spk fvox/blip");
				showColorMenu(id2);
 
				set_user_rendering(id2, kRenderFxPulseFastWide, 0, 0, 0, kRenderTransAdd, 128);
				ColorChat(0, TEAM_COLOR, "^x04[Chowany]^x03 %s^x01 znalazl^x03 %s^x01 !", szName[0], szName[1]);
				g_ChoosenColor[id2] = true;
			}
			else
			{
				ColorChat(id, TEAM_COLOR, "^x04[Chowany]^x03 Ten gracz juz wybral kolor!");
			}
		}
	}
	if(get_uc(uc, UC_Impulse) == 100)
	{
		g_FlashColor[id] = random(sizeof(g_FlashlightColors));
		g_HasFlashOn[id] = !g_HasFlashOn[id];
 
		set_uc(uc, UC_Impulse, 0);
		return FMRES_HANDLED;
	}
	return FMRES_IGNORED;
}
 
public PreThink(id)
{
	if(!is_user_alive(id))
		return FMRES_IGNORED;
 
	set_pev(id, pev_flTimeStepSound, 999);
	set_pev(id, pev_fuser2, 0.0);
 
	switch(get_user_team(id))
	{
		case 1:{
			if(!ilosc)
			{
				set_pev(id, pev_maxspeed, 550.0);
				set_pev(id, pev_gravity, 0.36);
			}
			else
			{
				set_pev(id, pev_maxspeed, -1.0);
				set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0});
			}
 
		}
		case 2:{
			if(!ilosc)
			{
				set_pev(id, pev_maxspeed, -1.0);
				set_pev(id, pev_velocity, Float:{0.0, 0.0, 0.0});
			}
			else
			{
				set_pev(id, pev_maxspeed, 550.0);
				set_pev(id, pev_gravity, 0.36);
			}
 
			if(g_HasFlashOn[id])
				Make_FlashLight(id, g_FlashColor[id]);
		}
	}
	return FMRES_IGNORED;
} 
 
Make_FlashLight(id, color)
{
	new Origin[3];
	get_user_origin(id, Origin, 3);
 
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY, .player=id);
	write_byte(TE_DLIGHT);
	write_coord(Origin[0]);
	write_coord(Origin[1]);
	write_coord(Origin[2]);
	write_byte(17);
	write_byte(g_FlashlightColors[color][0]);
	write_byte(g_FlashlightColors[color][1]);
	write_byte(g_FlashlightColors[color][2]);
	write_byte(1);
	write_byte(60);
	message_end();
 
	set_hudmessage(g_FlashlightColors[color][0], g_FlashlightColors[color][1], g_FlashlightColors[color][2], 0.05, 0.65, 0, 0.25, 0.25, 0.5, 0.5, 3);
	show_hudmessage(id, "swiecisz kolorem %s", g_FlashlightColorNames[color]);
}
 

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