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 ko8fimru0psg dodana przez Flk, 16.01.2013 19:11
Typ:



gyguguigug
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.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <codmod>
#include <hamsandwich>
 
#define DMG_BULLET (1<<1)
 
/*****KONFIGURACJA*****/
#define COLORCHAT
#define PREMIUM
#define PREDKOSC 340
#define MAX_PALIWO 60
#define WSPOLCZYNNIK_PALIWA 0.1
#define CO_ILE_TANKOWANIE 0.3
#define CO_ILE_SPALANIE 0.1
/*****KONFIGURACJA*****/
 
/*#define TASK_SPALANIE 666
#define TASK_TANKOWANIE 999*/
 
#if defined COLORCHAT
#include <colorchat>
#endif
 
 
new smoke;
new bool:has_jp[33];
new bool:has_started;
new frame[33];
new paliwo[33];
new max_paliwo[33];
 
new bool:ma_klase[33];
 
new const nazwa[] = "Jetpack (MEGA PREMIUM)";
new const opis[] = "Ma Jetpack (plecak odrzutowy), dodatkowe 25% obrazen z kazdej broni";
new const bronie    = (1<<CSW_SG552)|(1<<CSW_M4A1)|(1<<CSW_DEAGLE)|(1<<CSW_AK47);
new const zdrowie = 40;
new const kondycja = 20;
new const inteligencja = 30;
new const wytrzymalosc = 45;
 
public plugin_init() 
{
 
	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
 
	register_event("DeathMsg" , "Event_DeathMsg" , "a");
	register_event("HLTV" , "did_not_start" , "a" , "1=0" , "2=0");
 
	register_logevent("did_start" , 2 , "1=Round_Start");
 
	register_event("ResetHUD", "ResetHUD", "abe");
	register_event("CurWeapon","CurWeapon","be", "1=1")
	register_forward(FM_PlayerPreThink, "PlayerPreThink")
	register_forward(FM_UpdateClientData, "UpdateClientData_Post", 1)
	register_forward(FM_CmdStart,"fwd_CmdStart")
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
 
public plugin_natives()
{
	register_native("cod_get_user_class_fuel", "PobierzIlosc", 1);
	register_native("cod_get_user_class_max_fuel", "PobierzIloscMax", 1);
}
 
public plugin_precache() 
{
	smoke = precache_model("sprites/lightsmoke.spr");
	precache_model("models/p_egon.mdl")
	precache_model("models/v_egon.mdl")
	precache_sound("QTM_CodMod/jetpack.wav");
}
 
public cod_class_enabled(id)
{
	#if defined PREMIUM
	if(!(get_user_flags(id) & ADMIN_LEVEL_F))
	{
		#if defined COLORCHAT
		ColorChat(id, GREEN, "[Jetpack] Nie masz uprawnien, aby uzywac tej klasy.")
		#endif
		#if !defined COLORCHAT
		ColorChat(id, GREEN, "[Jetpack] Nie masz uprawnien, aby uzywac tej klasy.")
		#endif
		return COD_STOP;
	}
	#endif
	ma_klase[id] = true;
	paliwo[id] = MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round);
	max_paliwo[id] = MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round);
	#if defined COLORCHAT
	ColorChat(id, GREEN, "[Jetpack] Klasa stworzona przez kisiel96.");
	#endif
	#if !defined COLORCHAT
	client_print(id, print_chat, "[Jetpack] Klasa stworzona przez Flk.");
	#endif
	has_jp[id] = false;
	#if defined PREMIUM
	return COD_CONTINUE;
	#endif
}
 
public cod_class_disabled(id)
{
	ma_klase[id] = false;
	has_jp[id] = false;
}
 
public cod_class_skill_used(id)
{
	if(has_jp[id])
	{
		JetPackOff(id)
	}
	else
	{
		JetPackOn(id)
	}
}
 
public ResetHUD(id)
	paliwo[id] = MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round);
 
public PlayerPreThink(id)
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return FMRES_IGNORED;
	}
	if(!ma_klase[id])
	{
		return FMRES_IGNORED;
	}
	if(!has_jp[id])
	{
		SprawdzTankowanie(id)
		return FMRES_IGNORED;
	}	
	if(!has_started)
	{
		return FMRES_IGNORED;
	}
	else
	{
		SprawdzTankowanie(id)
	}
 
	set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK);
 
	if(get_user_button(id) & IN_JUMP) 
	{
		if(paliwo[id] > 0)
		{
			new Float:fAim[3] , Float:fVelocity[3];
			VelocityByAim(id , PREDKOSC, fAim);
 
			fVelocity[0] = fAim[0];
			fVelocity[1] = fAim[1];
			fVelocity[2] = fAim[2];
 
			set_user_velocity(id , fVelocity);
 
			entity_set_int(id , EV_INT_gaitsequence , 6);
 
			emit_sound(id , CHAN_VOICE , "QTM_CodMod/jetpack.wav" , 1.0 , ATTN_NORM , 0 , PITCH_NORM);
 
			if(frame[id] >= 3) 
			{
				frame[id] = 0;
				smoke_effect(id);
				entity_set_string(id , EV_SZ_weaponmodel , "models/p_egon.mdl");
			}
			frame[id]++;
 
			SprawdzSpalanie(id)
 
 
		}
		else
		{
			client_print(id, print_center, "Skonczylo Ci sie paliwo! Automatycznie zdjales Jetpack!");
			has_jp[id] = false;
 
			SprawdzTankowanie(id)
		}
	}
	else
	{
		SprawdzTankowanie(id)
	}
	return FMRES_IGNORED;
}
 
public UpdateClientData_Post(id, sendweapons, cd_handle)
{
	if(!is_user_connected(id)) 
	{
		return FMRES_IGNORED;
	}
	if(!is_user_alive(id))
	{
		return FMRES_IGNORED;
	}
	if(!ma_klase[id])
	{
		return FMRES_IGNORED;
	}
	if(has_jp[id])
	{
		set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001 ); 
	}
 
	return FMRES_HANDLED;
}
 
public fwd_CmdStart(id, uc_handle, seed)
{
	if(!is_user_connected(id)) 
	{
		return FMRES_IGNORED;
	}
	if(!is_user_alive(id))
	{
		return FMRES_IGNORED;
	}
	if(!ma_klase[id])
	{
		return FMRES_IGNORED;
	}
 
	new buttons = get_uc(uc_handle, UC_Buttons)
	new oldbuttons = get_user_oldbutton(id);
 
	if((buttons & IN_ATTACK) || !(oldbuttons & IN_ATTACK))
	{
		return FMRES_IGNORED;
	}
	if(has_jp[id])         
	{
		set_uc(uc_handle, UC_Buttons, buttons & ~IN_ATTACK);
		return FMRES_HANDLED;
	}
	return FMRES_IGNORED;
}
 
public SprawdzSpalanie(id)
{
	if(paliwo[id] > 0)
	{
		static Float:Last[33];
 
		new Float:Now = get_gametime();
		if((Now - Float:Last[id]) >= CO_ILE_SPALANIE)
		{
			Spalanie(id);
 
			Last[id] = Now;
		}
	}
}
 
public SprawdzTankowanie(id)
{
	if(paliwo[id] < MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round))
	{
		static Float:Last[33];
 
		new Float:Now = get_gametime();
		if((Now - Float:Last[id]) >= CO_ILE_TANKOWANIE)
		{
			Tankowanie(id);
 
			Last[id] = Now;
		}
	}
}
 
public Spalanie(id)
{
	paliwo[id]--;
}
 
public Tankowanie(id)
{
	paliwo[id]++;
}
 
public CurWeapon(id)
{
	//new weapon = read_data(2);
 
	if(ma_klase[id]) //tutaj wstawiamy ma_klase lub ma_perk
	{
		if(has_jp[id]) //tutaj ustawiamy broń, jakiej model będziemy zmieniać
		{
			set_pev(id, pev_viewmodel2, "models/v_egon.mdl")
			set_pev(id, pev_weaponmodel2, "models/p_egon.mdl")
		}
	}
}
 
public smoke_effect(id) 
{
	new origin[3];
	get_user_origin(id, origin, 0);
	origin[2] = origin[2] - 10;
 
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(17);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]);
	write_short(smoke);
	write_byte(10);
	write_byte(115);
	message_end();
}
 
public JetPackOn(id) 
{	
	if(!ma_klase[id])
	{
		return PLUGIN_HANDLED;
	}
	if(!is_user_alive(id)) 
	{
		client_print(id , print_center , "Nie mozesz zalozyc plecaka gdy nie zyjesz!");
		return PLUGIN_HANDLED;
	}
 
	if(has_jp[id]) 
	{
		client_print(id , print_center , "Masz juz ubrany Jetpack!");
		return PLUGIN_HANDLED;
	}
 
	has_jp[id] = true;
 
	client_print(id , print_center , "Ubrales Jetpack! By go uzyc trzymaj klawisz skoku i kieruj myszka");
 
	emit_sound(id , CHAN_VOICE , "items/gunpickup2.wav" , 1.0 , ATTN_NORM , 0 , PITCH_NORM);
 
	return PLUGIN_HANDLED;
}
 
public JetPackOff(id)
{
	if(!ma_klase[id])
	{
		return PLUGIN_HANDLED;
	}
 
	if(!has_jp[id]) 
	{
		client_print(id , print_center , "Nie masz ubranego Jetpacka!");
		return PLUGIN_HANDLED;
	}
 
	client_print(id , print_center , "Zdjeles Jetpack!");
 
	has_jp[id] = false;
 
	return PLUGIN_HANDLED;
}
 
public did_not_start() 
{
	has_started = false;
 
	new aPlayers[32] , iNum , i;
	get_players(aPlayers, iNum);
	for(i = 1; i <= iNum; i++) 
	{
		has_jp[aPlayers[i]] = false;
	}
	new ent = -1;
	while((ent = find_ent_by_class(ent , "jetpack")) != 0) 
	{
		remove_entity(ent);
	}
}
 
public did_start() 
{
	has_started = true;
}
 
public client_connect(id) 
{
	has_jp[id] = false;
}
 
public client_disconnect(id)
{
	has_jp[id] = false;
}
 
public PobierzIlosc(id)
{
	if(ma_klase[id])
		return paliwo[id];
	return 0;
}
 
public PobierzIloscMax(id)
{
	if(ma_klase[id])
		return MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round);
	return 0;
}
 
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
                if(!is_user_connected(idattacker))
                                return HAM_IGNORED;
 
                if(!ma_klase[idattacker])
                                return HAM_IGNORED;
 
                if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)
                                cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);
 
                if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET)
                                cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);
 
                if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_SG552 && damagebits & DMG_BULLET)
                                cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);
 
                if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET)
                                cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits);
 
                return HAM_IGNORED;
}
 
/*
******************************
* END OF FILE
******************************
*/
////////////////////////////
 

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