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 132768509614318 dodana przez fbang, 27.01.2012 18:24
Typ:


132768509614318
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.
484.
485.
486.
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <xs>
#include <engine>
 
#define FLAG ADMIN_LEVEL_H
 
new const VIP[] = "DeathRunVipp"
new const VIP_MODEL[] = "models/player/DeathRunVipp/DeathRunVipp.mdl"
 
new const MENU_POPUP[] = "misc/DeathRunVip/vip_menu_popup.wav"
new const MENU_OK[] = "misc/DeathRunVip/vip_menu_ok.wav"
 
#define TASKID_SHOWHUD	2931
#define TASKID_MODEL		3810 
 
new player_model[33][32]
new Float: g_counter
new bool: g_model[33]
new g_hudsync
new cvar_gravity
new cvar_speed
new SayTxT
 
new gCylinderSprite;
 
public plugin_precache()
{
	precache_model(VIP_MODEL)
 
	precache_sound(MENU_POPUP)
	precache_sound(MENU_OK)
 
	gCylinderSprite = precache_model( "sprites/shockwave.spr" );
}
 
public plugin_init()
{
	register_plugin("Deathrun V.I.P", "1.0", "DoviuX")
 
	cvar_gravity = register_cvar("dr_vip_gravity", "500")
	cvar_speed = register_cvar("dr_vip_speed", "500")
 
	RegisterHam(Ham_Spawn, "player", "bacon_spawn", 1)
	register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
	register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
 
	g_hudsync = CreateHudSyncObj()
	SayTxT = get_user_msgid("SayText");
}
 
public bacon_spawn(id)
{
	if (!is_user_alive(id))
		return
 
	static CsTeams: team ; team = cs_get_user_team(id)
 
	if (team == CS_TEAM_T && (get_user_flags(id) & FLAG))
	{   
		set_task(5.0, "T_menu", id)
 
		new iOrigin[ 3 ];
		get_user_origin( id, iOrigin );
 
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
 
		copy(player_model[id], 31, VIP)
 
		new currentmodel[32];
		fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
 
		if(!equal(currentmodel, player_model[id]))
		{
			Task_Model(id + TASKID_MODEL)
			g_counter += 0.1;
		}
 
		if(!task_exists(TASKID_SHOWHUD + id))
			set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)
 
		set_user_rendering(id,kRenderFxGlowShell,128,0,255,kRenderNormal,0) 
	}
	else if (team == CS_TEAM_CT && (get_user_flags(id) & FLAG))
	{
		set_task(5.0, "CT_menu", id)
 
		new iOrigin[ 3 ];
		get_user_origin( id, iOrigin );
 
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
		Create_BeamCylinder( iOrigin, 120, gCylinderSprite, 0, 0, 6, 16, 0, random( 0 ), random( 255 ), random( 0 ), 255, 0 );
 
		copy(player_model[id], 31, VIP)
 
		strip_user_weapons(id)
		give_item(id, "weapon_usp")
		give_item(id, "weapon_knife")
 
		new currentmodel[32];
		fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
 
		if(!equal(currentmodel, player_model[id]))
		{
			Task_Model(id + TASKID_MODEL)
			g_counter += 0.1;
		}
 
		if(!task_exists(TASKID_SHOWHUD + id))
			set_task(0.2, "Task_ShowHUD", TASKID_SHOWHUD + id)
 
		set_user_rendering(id,kRenderFxGlowShell,128,0,255,kRenderNormal,0) 
	}
}
 
public T_menu(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
 
	client_cmd(id, "spk %s", MENU_POPUP)
 
	new gmenu = menu_create("\yMenu VIP" , "Vip_Handler");
	menu_additem(gmenu ,"\r50 \wHealth", "1" , 0);
	menu_additem(gmenu ,"\r50 \wArmor", "2" , 0);
	menu_additem(gmenu ,"\wGrawitacja", "3" , 0);
	menu_additem(gmenu ,"\wSzybkosc", "4" , 0);
	menu_additem(gmenu ,"\wDeagle z \r2 nabojami", "5" , 0);
	menu_additem(gmenu ,"\wFlashbang", "6" , 0);
	menu_additem(gmenu ,"\wNoktowizor (\ridealny na ciemne mapy\w)", "7" , 0);
 
	menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);
 
	menu_display(id , gmenu , 0);
 
	return PLUGIN_CONTINUE
}
 
public CT_menu(id)
{
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
 
	client_cmd(id, "spk %s", MENU_POPUP)
 
	new gmenu = menu_create("\yMenu VIP" , "VipCt_Handler");
	menu_additem(gmenu ,"\r50 \wHP", "1" , 0);
	menu_additem(gmenu ,"\r50 \wAP", "2" , 0);
	menu_additem(gmenu ,"\wGrawitacja", "3" , 0);
	menu_additem(gmenu ,"\wSzybkosc", "4" , 0);
	menu_additem(gmenu ,"\wZamrazacz", "5" , 0);
	menu_additem(gmenu ,"\wNoktowizor (\ridealny na ciemne mapy\w)", "6" , 0);
 
	menu_setprop(gmenu , MPROP_EXIT , MEXIT_ALL);
 
	menu_display(id , gmenu , 0);
 
	return PLUGIN_CONTINUE
}
 
public Vip_Handler(id, gmenu, item, player)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(gmenu)
		return PLUGIN_HANDLED
	}
 
	new data[6], iName[64]
	new access, callback
	menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)
 
	new key = str_to_num(data)
 
	switch(key)
	{
		case 1:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_health(id, 50)
			client_printcolor(id, "/g[VIP]/y: Dostales /w50 /gzdrowia!")
		}
 
		case 2:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_armor(id, 50)
			client_printcolor(id, "/g[VIP]/y: Dostales /w50 /gAP!")
		}
 
		case 3:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			new Float: gravity
			gravity	= get_pcvar_float(cvar_gravity) / 800
 
			set_user_gravity(id, gravity)
			client_printcolor(id, "/g[VIP]/y: Wybrales /ggrawitacje!")
		}
 
		case 4:
		{
			new Float: speed
			speed	= get_pcvar_float(cvar_speed)
 
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_maxspeed(id, speed)
			client_printcolor(id, "/g[VIP]/y: Dostales wiekszego /gspeeda!")
		}
 
		case 5:
		{
			give_item(id, "weapon_deagle")
 
			new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id);
			if(weapon_id)
			{
				cs_set_weapon_ammo(weapon_id, 2);
			}
 
			client_cmd(id, "spk %s", MENU_OK)
 
			client_printcolor(id, "/g[VIP]/y: Dostales deagla z /g2 /ynabojami!")
		}
 
		case 6:
		{
			give_item(id, "weapon_flashbang")
 
			client_cmd(id, "spk %s", MENU_OK)
 
			client_printcolor(id, "/g[VIP]/y: Wybrales /yFlashbanga!")
		}
 
		case 7:
		{
			cs_set_user_nvg(id)
 
			client_cmd(id, "spk %s", MENU_OK)
 
			client_printcolor(id, "/g[VIP]/y: Dostales noktowizor!")
		}
	}
	menu_destroy(gmenu)
	return PLUGIN_HANDLED;
}
 
public VipCt_Handler(id, gmenu, item, player)
{
	if (item == MENU_EXIT)
	{
		menu_destroy(gmenu)
		return PLUGIN_HANDLED
	}
 
	new data[6], iName[64]
	new access, callback
	menu_item_getinfo(gmenu, item, access, data, 5, iName, 63, callback)
 
	new key = str_to_num(data)
 
	switch(key)
	{
		case 1:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_health(id, 50)
			client_printcolor(id, "/g[VIP]/y: Dostales /w50 /gHP!")
		}
 
		case 2:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_armor(id, 50)
			client_printcolor(id, "/g[VIP]/y: Dostales /w50 /gAP!")
		}
 
		case 3:
		{
			client_cmd(id, "spk %s", MENU_OK)
 
			new Float: gravity
			gravity	= get_pcvar_float(cvar_gravity) / 800
 
			set_user_gravity(id, gravity)
			client_printcolor(id, "/g[VIP]/y: Dostales /ggrawitacje!")
		}
 
		case 4:
		{
			new Float: speed
			speed	= get_pcvar_float(cvar_speed)
 
			client_cmd(id, "spk %s", MENU_OK)
 
			set_user_maxspeed(id, speed)
			client_printcolor(id, "/g[VIP]/y: Dostales /gszybkosc!")
		}
 
		case 5:
		{
			give_item(id, "weapon_smokegrenade")
 
			client_cmd(id, "spk %s", MENU_OK)
 
			client_printcolor(id, "/g[VIP]/y: Dostales /gzamrazacz /ypulapek!")
		}
 
		case 6:
		{
			cs_set_user_nvg(id)
 
			client_cmd(id, "spk %s", MENU_OK)
 
			client_printcolor(id, "/g[VIP]/y: Dostales noktowizor!")
		}
	}
	menu_destroy(gmenu)
	return PLUGIN_HANDLED;
}
 
public Task_ShowHUD(task)
{
	new id = task - TASKID_SHOWHUD
 
	if(!is_user_alive(id))
		return PLUGIN_HANDLED
 
	static health, armour
	health = get_user_health(id)
	armour = get_user_armor(id)
 
	set_hudmessage(150, 150, 150, 0.40, 0.92, 0, 0.0, 0.3, 0.0, 0.0)
	ShowSyncHudMsg(id, g_hudsync , ".::*Health: %d -|V.I.P|- Armour: %d*::.", health, armour)
 
	set_task(0.1, "Task_ShowHUD", TASKID_SHOWHUD + id)		
 
	return PLUGIN_CONTINUE
}
 
public client_PreThink(id)
{
	if(is_user_alive(id))
	{
		if(get_user_flags(id) & FLAG)
		{
 
			new oldbuttons = get_user_oldbutton(id);
 
 
			oldbuttons &= ~IN_JUMP;
			entity_set_int(id, EV_INT_oldbuttons, oldbuttons);
		}
	}
}  
 
public Task_Model(task)
{
	new id = task - TASKID_MODEL 
 
	fm_set_user_model(id, player_model[id])
}
 
stock Create_BeamCylinder( origin[ 3 ], addrad, sprite, startfrate, framerate, life, width, amplitude, red, green, blue, brightness, speed )
{
	message_begin( MSG_PVS, SVC_TEMPENTITY, origin ); 
	write_byte( TE_BEAMCYLINDER );
	write_coord( origin[ 0 ] );
	write_coord( origin[ 1 ] );
	write_coord( origin[ 2 ] );
	write_coord( origin[ 0 ] );
	write_coord( origin[ 1 ] );
	write_coord( origin[ 2 ] + addrad );
	write_short( sprite );
	write_byte( startfrate );
	write_byte( framerate );
	write_byte(life );
	write_byte( width );
	write_byte( amplitude );
	write_byte( red );
	write_byte( green );
	write_byte( blue );
	write_byte( brightness );
	write_byte( speed );
	message_end();
}
 
stock te_sprite(id, Float:origin[3], sprite, scale, brightness)
{
	message_begin(MSG_ONE, SVC_TEMPENTITY, _, id)
	write_byte(TE_SPRITE)
	write_coord(floatround(origin[0]))
	write_coord(floatround(origin[1]))
	write_coord(floatround(origin[2]))
	write_short(sprite)
	write_byte(scale) 
	write_byte(brightness)
	message_end()
}
 
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
}
 
public fw_SetClientKeyValue(id, infobuffer, key[], value[])
{   
	if (g_model[id] && equal(key, "model"))
		return FMRES_SUPERCEDE
 
	return FMRES_IGNORED
}
 
public fw_ClientUserInfoChanged(id, infobuffer)
{   
	if (!g_model[id])
		return FMRES_IGNORED
 
	new currentmodel[32]; 
	fm_get_user_model(id, currentmodel, sizeof currentmodel - 1);
 
	if(!equal(currentmodel, player_model[id]))
		fm_set_user_model(id, player_model[id]) 
 
	return FMRES_IGNORED
}
 
stock fm_set_user_model(player, modelname[])
{   
	engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)
 
	g_model[player] = true
}
 
stock fm_get_user_model(player, model[], len)
{   
	engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}
 
stock fm_reset_user_model(player)
{         
	g_model[player] = false
 
	dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}
 
stock client_printcolor(const id, const input[], any:...)
{
	new count = 1, players[32];
	static msg[191];
	vformat(msg,190,input,3);
	replace_all(msg,190,"/g","^4");// green txt
	replace_all(msg,190,"/y","^1");// orange txt
	replace_all(msg,190,"/ctr","^3");// team txt
	replace_all(msg,190,"/w","^0");// team txt
	if (id) players[0] = id; else get_players(players,count,"ch");
	for (new i = 0; i < count; i++)
		if (is_user_connected(players[i]))
	{
		message_begin(MSG_ONE_UNRELIABLE, SayTxT, _, players[i]);
		write_byte(players[i]);
		write_string(msg);
		message_end();
	}
}	
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/