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 1kaz2o7pu16ka dodana przez misiecki2, 02.09.2013 07:25
Typ:



Poprawienie Klasy
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.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <ColorChat>
#include <fakemeta_util>
 
 
#define CZAS_GODMOD 5 //sekundy
#define MAX 32
#define DMG_BULLET (1<<1)
 
 
static const g_szWpnEntNames[] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
	"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
	"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
	"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
	"weapon_ak47", "weapon_knife", "weapon_p90" }
 
 
new ma_klase[MAX+1], flashlight[MAX+1],flashbattery[MAX+1]
new const nazwa[]   = "Kim Dzong Un";
new const opis[]    = "Made in China";
new const bronie    = (1<<CSW_HEGRENADE)|(1<<CSW_FAMAS)|(1<<CSW_AK47);
new const zdrowie   = 0;
new const kondycja  = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
 
new sprite_blast;
new ilosc_rakiet_gracza[33];
new poprzednia_rakieta_gracza[33];
 
new skoki[33];
 
//new bool:ma_klase[33];
 
new bool:wykorzystal[33];
new msg_bartime;
 
public plugin_init()
{
	register_plugin(nazwa, "1.0", "amxx.pl");
 
	cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
	register_touch("rocket", "*" , "DotykRakiety");
	RegisterHam(Ham_Spawn, "player", "fwSpawn_Rakiety", 1);
	msg_bartime = get_user_msgid("BarTime");
	register_event("ResetHUD", "ResetHUD", "abe");
	register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
 
 
	register_forward(FM_PlayerPreThink,"PreThink");
	register_event("Flashlight","Flashlight","b");
	register_cvar("cod_mag_render", "30");
 
 
	register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1)
 
	register_forward(FM_UpdateClientData, "UpdateClientData", 1)
 
 
	RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
 
	register_event("CurWeapon","CurWeapon","be", "1=1");
}
 
 
public plugin_precache()
{
 
	sprite_blast = precache_model("sprites/dexplo.spr");
	precache_model("models/rpgrocket.mdl");
 
}
 
public client_disconnect(id)
{
 
	new entRakiety = find_ent_by_class(0, "rocket");
	while(entRakiety > 0)
	{
		if(entity_get_edict(entRakiety, EV_ENT_owner) == id)
			remove_entity(entRakiety);
		entRakiety = find_ent_by_class(entRakiety, "rocket");
	}
 
}
 
public cod_class_enabled(id)
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_C))
	{
		client_print(id, print_chat, "[Kim Dzong Un] Nie masz uprawnien, aby uzywac tej klasy.")
		return COD_STOP;
	}
 
	ilosc_rakiet_gracza[id] = 4;
	give_item(id, "weapon_hegrenade");
	cs_set_user_nvg(id, 1);
	cs_set_user_defuse(id, 1);
	ma_klase[id] = true;
 
	return COD_CONTINUE;
	flashbattery[id] = get_cvar_num("cod_mag_render");
 
	cod_give_weapon(id, CSW_M3);
}
 
public cod_class_disabled(id)
{
	ma_klase[id] = false;
	flashbattery[id] = 0;
	cod_take_weapon(id, CSW_M3);
}
 
public cod_class_skill_used(id)
{
 
	if (!ilosc_rakiet_gracza[id])
	{
		client_print(id, print_center, "Wykorzystales juz wszystkie rakiety!");
	}
	else
	{
		if(poprzednia_rakieta_gracza[id] + 2.0 > get_gametime())
		{
			client_print(id, print_center, "Rakiet mozesz uzywac co 2 sekundy!");
		}
 
		else
		{
			if (is_user_alive(id))
			{
				poprzednia_rakieta_gracza[id] = floatround(get_gametime());
				ilosc_rakiet_gracza[id]--;
 
				new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
 
				entity_get_vector(id, EV_VEC_v_angle, vAngle);
				entity_get_vector(id, EV_VEC_origin , Origin);
 
				new Ent = create_entity("info_target");
 
				entity_set_string(Ent, EV_SZ_classname, "rocket");
				entity_set_model(Ent, "models/rpgrocket.mdl");
 
				vAngle[0] *= -1.0;
 
				entity_set_origin(Ent, Origin);
				entity_set_vector(Ent, EV_VEC_angles, vAngle);
 
				entity_set_int(Ent, EV_INT_effects, 2);
				entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
				entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
				entity_set_edict(Ent, EV_ENT_owner, id);
 
				VelocityByAim(id, 1000 , Velocity);
				entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
			}
		}
	}
 
 
 
	if(!is_user_alive(id))
	return;
 
	 if(wykorzystal[id])
	 {
	   ColorChat(id, RED, "Wykorzystales juz swoja niesmiertelnosc.");
	   return;
	 }
 
	 wykorzystal[id] = true;
 
	 set_user_godmode(id, 1);
	 set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0);
	 set_task(CZAS_GODMOD.0, "WylaczGod", id);
 
	 message_begin(MSG_ONE, msg_bartime, _, id)
	 write_short(CZAS_GODMOD)
	 message_end()
}
 
public fwSpawn_Rakiety(id)
{
	if(is_user_alive(id))
		ilosc_rakiet_gracza[id] = 4;
}
 
public DotykRakiety(ent)
{
	if (!is_valid_ent(ent))
		return;
 
	new attacker = entity_get_edict(ent, EV_ENT_owner);
 
 
	new Float:fOrigin[3];
	entity_get_vector(ent, EV_VEC_origin, fOrigin);
 
	new iOrigin[3];
	for(new i=0;i<3;i++)
		iOrigin[i] = floatround(fOrigin[i]);
 
	message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
	write_byte(TE_EXPLOSION);
	write_coord(iOrigin[0]);
	write_coord(iOrigin[1]);
	write_coord(iOrigin[2]);
	write_short(sprite_blast);
	write_byte(32);
	write_byte(20);
	write_byte(0);
	message_end();
 
	new entlist[33];
	new numfound = find_sphere_class(ent, "player", 190.0, entlist, 32);
 
	for (new i=0; i < numfound; i++)
	{
		new pid = entlist[i];
 
		if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
			continue;
		cod_inflict_damage(attacker, pid, 55.0, 0.9, ent, (1<<24));
	}
	remove_entity(ent);
}
 
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 WylaczGod(id)
{
	 if(!is_user_connected(id)) return;
 
	 set_user_godmode(id, 0);
	 set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0);
}
public ResetHUD(id)
	 wykorzystal[id] = false;
 
 
public PreThink(id)
{
	if(!is_user_alive(id))
		return FMRES_IGNORED;
 
	if(flashlight[id] && flashbattery[id] && ma_klase[id]) 
	{
		static flashlight_r, flashlight_g, flashlight_b;
		flashlight_r+= 1+random_num(0,2)
 
		if (flashlight_r>250) 
			flashlight_r-=245
 
		flashlight_g+= 1+random_num(-1,1)
 
		if (flashlight_g>250) 
			flashlight_g-=245
 
		flashlight_b+= -1+random_num(-1,1)
 
		if (flashlight_b<5) 
			flashlight_b+=240	
 
		new origin[3];
		get_user_origin(id, origin, 3);
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(27);
		write_coord(origin[0]);
		write_coord(origin[1]);
		write_coord(origin[2]);
		write_byte(8);
		write_byte(flashlight_r);
		write_byte(flashlight_g);
		write_byte(flashlight_b);
		write_byte(1);
		write_byte(90);
		message_end();
 
		new traget, bodypart;
		get_user_aiming(id, traget, bodypart) 
		if(get_user_team(id) != get_user_team(traget) && traget)
		{
			new data[2];
			data[0] = traget;
			data[1] = pev(traget, pev_renderamt);
 
			if(data[1] < 255.0)
			{
				fm_set_rendering(traget, kRenderFxGlowShell, flashlight_r, flashlight_g, flashlight_b, kRenderNormal, 4)	
 
				remove_task(8752+traget);
				set_task(7.5, "wylacz_rander", 8752+traget, data, 2)
			}
		}
	}
 
	if(ma_klase[id])
		set_pev(id, pev_punchangle, {0.0,0.0,0.0})
 
	return FMRES_HANDLED;
} 
 
public wylacz_rander(data[2])
{
	if(is_user_connected(data[0]) && is_user_alive(data[0]))
		fm_set_rendering(data[0], kRenderFxNone, 0, 0, 0, kRenderTransAlpha, data[1])	
}
 
public Flashlight(id)
{
	if(flashlight[id])
		flashlight[id] = 0;
	else if(flashbattery[id] > 0)
		flashlight[id] = 1;
 
	if(!task_exists(2071+id))
		set_task(flashlight[id]? 0.5: 1.0, "charge", 2071+id);
 
	message_begin(MSG_ONE,get_user_msgid("Flashlight"),{0,0,0},id);
	write_byte(flashlight[id]);
	write_byte(flashbattery[id]);
	message_end();
 
	set_pev(id, pev_effects, pev(id, pev_effects) & ~EF_DIMLIGHT);
}
 
public charge(id) 
{
	id -= 2071
	if(flashlight[id])
		flashbattery[id]--;
	else 
		flashbattery[id]++;
 
	message_begin(MSG_ONE,get_user_msgid("FlashBat"),{0,0,0},id);
	write_byte(flashbattery[id]);
	message_end();
 
	if(flashbattery[id] <= 0)
	{
		flashbattery[id] = 0;
		flashlight[id] = 0;
 
		message_begin(MSG_ONE,get_user_msgid("Flashlight"),{0,0,0},id);
		write_byte(flashlight[id]);
		write_byte(flashbattery[id]);
		message_end();
	}
	else if(flashbattery[id] >= get_cvar_num("cod_mag_render")) 
	{
		flashbattery[id] = get_cvar_num("cod_mag_render");
		return;
	}
	set_task(flashlight[id]? 0.5: 1.0,"charge", 2071+id)
}
 
 
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_connected(idattacker))
		return HAM_IGNORED;
 
	if(!ma_klase[idattacker])
		return HAM_IGNORED;
 
//Więcej DMG
	if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_FAMAS && damagebits & DMG_BULLET)
		cod_inflict_damage(idattacker, this, 50.0, 0.0, idinflictor, damagebits);
 
	if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)
		cod_inflict_damage(idattacker, this, 50.0, 0.0, idinflictor, damagebits);
 
//Natychmiast z HE
	if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_FAMAS && get_pdata_int(this, 75, 5) == HIT_HEAD && random_num(1, 2) == 1)
		cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor);
 
	if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && get_pdata_int(this, 75, 5) == HIT_HEAD && random_num(1, 2) == 1)
		cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor);
 
//x% więcej dmg
	if(damagebits & DMG_BULLET)
	{	
	if(ma_klase[idattacker])
			cod_inflict_damage(idattacker, this, damage*0.2, 0.1, idinflictor, damagebits);	
	}
 
 
//1/3 Z shotguna
//	if(get_user_weapon(idattacker) != CSW_M3)
//		return HAM_IGNORED;
//	if(!(damagebits & DMG_BULLET))
//		return HAM_IGNORED;
//	if(random(wartosc_perku[idattacker]))
//		return HAM_IGNORED;
//	cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
//	
 
	return HAM_IGNORED;
}
 
public FwdAddToFullPack(es_handle, e, ent, host, hostflags, player, pSet)
{
	if(!is_user_connected(host) || !is_user_connected(ent))
		return;
 
	if(!ma_klase[host])
		return;
 
	set_es(es_handle, ES_RenderAmt, 255.0);
}
 
public UpdateClientData(id, sw, cd_handle)
{
	if(ma_klase[id])
		set_cd(cd_handle, CD_PunchAngle, {0.0,0.0,0.0})   
}
 
public CurWeapon(id)
{
	if(!is_user_connected(id) || !is_user_alive(id) || !ma_klase[id])
		return PLUGIN_CONTINUE;
 
	new iEnt;
 
	static Float:fSpeedMultiplier;
 
	fSpeedMultiplier = floatdiv(1.0, 1.0+(float(50)/100.0));
 
	for (new i = 1; i < sizeof g_szWpnEntNames; i++)
	{
		iEnt = fm_find_ent_by_owner(-1, g_szWpnEntNames[i], id)
 
		if(iEnt)
		{
			set_pdata_float( iEnt, 46, ( get_pdata_float(iEnt, 46, 4) * fSpeedMultiplier), 4 );
			set_pdata_float( iEnt, 47, ( get_pdata_float(iEnt, 47, 4) * fSpeedMultiplier), 4 );
		}
	}
	return PLUGIN_CONTINUE;	
 
	set_user_clip(id, 2);
}
 
stock set_user_clip(id, ammo)
{
	new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
	get_weaponname(weapon, weaponname, 31);
	while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
		if (pev(weaponid, pev_owner) == id) {
		set_pdata_int(weaponid, 51, ammo, 4);
		return weaponid;
	}
	return 0;
}
 

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