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 7bgyvec14fr dodana przez Misiaczek ;c, 28.01.2014 12:33
Typ:



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.
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#pragma semicolon 1 
 
new bool:gPlayerFirstSpawn[33];
new bool:g_is_warmup;
new g_warmup_time;
new time_left;
new g_cvar_respawn;
 
/*
Plugin was originally developed by x-raycat(I've changed almost everything and added so many features)
Cvary/cvars
amx_warmup_time <x> gdzie x to czas w sekundach
amx_warmup_time <x> where x is time in seconds
 
amx_warmup_respawn(0- ożywianie wyłączone, 1- ożywianie włączone)
amx_warmup_respawn(0- auto-respawn off, 1- auto-respawn ON)
 
amx_warmup_weapon:
Każdy numer odpowiada broni.
amx_warmup_weapon:
Each number is a weapon for this plugin. List:
 
1   weapon_p228			//p228
2   weapon_scout    		//scout         
3   weapon_hegrenade		//granat HE
4   weapon_xm1014		//auto-pompa
5   weapon_mac10           	//uzi tt              
6   weapon_aug        		//aug      
7   weapon_elites		//elites        
8   weapon_fiveseven		//fiveseven
9   weapon_ump45		//b(3(2))
10   weapon_sg550		//autokampa cT
11   weapon_galil		//galil
12   weapon_famas		//famas
13   weapon_usp			//usp
14   weapon_glock18		//glock
15   weapon_awp  		//awp
16   weapon_mp5navy   		//MP5
17   weapon_m249       		//krowa
18   weapon_m3         		//pompa
19   weapon_m4a1        	//M4
20   weapon_tmp         	//tmp
21   weapon_g3sg1		//autokampa TT
22   weapon_deagle		//dgl
23   weapon_sg552		//sg552(tt)
24   weapon_ak47		//ak47
25   weapon_p90  		//P90
26   weapon_knife		//nóż
27   is random weapons from above
Ustawienie każdej innej wartości cvaru amx_warmup_weapon powoduje ustawienie domyślnej broni- nóż.
By setting any different number as a cvar value causes to use default weapon- knife.
 
Change-Log
v.1.7
- added random wepons,
- added example on disabling plugins during the warmup,
- code cleanup,
- new languages,
- blocking weapon pickup during the warmup,
- blocking weapon dropping during the warmup.
 
v.1.6
- replaced game commencing event instead of task,
- changed way of using amx_warmup_time cvar, now it's defined in seconds,
- removed some useless code,
- added possiblity to disable plugins during warm-up.
 
 
v.1.5c
-added serbian translation.
 
v.1.5b
- changed way of giving ammo,
- changed a little in weapon switch,
- added Turkish and Bulgarian translations
 
v.1.4
- code cleanup: fixed identation, used pcvars.
 
 
v.1.3
- added multilingual support,
- added commented examples of using mp3 format.
 
v.1.2
- little code cleanup.
 
v.1.1
- added most of available things: weapons, respawns, countdown, sound.
 
v.1.0
- first written, testing, testing and once more testing.
 
 
To do list:
- random weapons.
*/
 
new const gszPausePlugins[ ][ ] = {
	"lokalizator.amxx",
	"vip.amxx"
};
 
public plugin_init()
{
	register_plugin("Ultimate Warm-Up", "1.7.1", "naven");
	g_warmup_time = register_cvar("amx_warmup_time", "65");
	g_cvar_respawn = register_cvar("amx_warmup_respawn", "1");
	register_cvar("amx_warmup_weapon", "1");
	register_event("ResetHUD", "Event_ResetHud", "be");
	register_event("DeathMsg", "DeathMsg", "a");
	register_dictionary("ultimate_warmup.txt");
	register_event("TextMsg","restart_time","a","2&#Game_C"); //thx Pavulon
	register_clcmd("amx_start_warmup", "restart_time", ADMIN_KICK);
	RegisterHam( Ham_Touch, "weaponbox", "HamTouchPre", 0 );
	RegisterHam( Ham_Touch, "armoury_entity", "HamTouchPre", 0 );
	register_clcmd("drop", "handle_drop");
}
public muza_on()
{
	//let's play the music
	client_cmd(0,"stopsound");	//silence .wav sounds
	client_cmd(0,"mp3 stop");	//silence .mp3 sounds
	client_cmd(0,"mp3 play sound/sound_name.mp3");
}
public restart_time()
{
	//pausing plugins
	for( new i = 0; i < sizeof gszPausePlugins; i++ ) {
		pause( "ac", gszPausePlugins[ i ] );
	}
	g_is_warmup = true;
	init_warmup_time();
	muza_on();
	return PLUGIN_HANDLED;
}
public restartround(id)
{
	gPlayerFirstSpawn[id] = true;
	return PLUGIN_HANDLED;
}
public countdown()
{
	time_left--;
	if(time_left < 0)
	{
		restart();
	}
	return PLUGIN_CONTINUE;
}
public init_warmup_time()
{
	new time[256], temp[2][6];
	get_pcvar_string(g_warmup_time, time, 255);
 
	parse(time, temp[0], 5, temp[1], 5);
 
	time_left = str_to_num(temp[0]) /** 60*/ + str_to_num(temp[1]);
	set_task(1.0, "countdown", 4567,_,_,"b");
	set_task(1.0, "show_time", 2345,_,_,"b");
}
 
public show_time()
{
	set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, random_float(0.15, 0.40), /*0.31,*/ 0, 6.0, 2.0);
	show_hudmessage(0, "%L", LANG_PLAYER, "WARMUP_COUNTDOWN", time_left / 60, time_left % 60);	//countdown
}
public restart()
{
	//unpausing plugins
	for( new i = 0; i < sizeof gszPausePlugins; i++ ) {
		unpause( "ac", gszPausePlugins[ i ] );
	}
	g_is_warmup = false;
	remove_task(4567);
	remove_task(2345);
 
	server_cmd("sv_restart 1");
	new Players[32], playerCount;
	get_players(Players, playerCount);
	for (new i=0; i<playerCount; i++)
	{
		new id = Players[i];
		if(cs_get_user_bpammo(id, CSW_HEGRENADE))
			cs_set_user_bpammo(id, CSW_HEGRENADE, 0);
	}
}
public Event_ResetHud(id)
{
	if(g_is_warmup)
	{
		set_task(0.1, "task_give", id);	//after spawn
	} 
}
public DeathMsg()
{
	new l_cvar_respawn = get_pcvar_num(g_cvar_respawn);
	if((g_is_warmup) && (l_cvar_respawn ==1))
 
{
	new id = read_data(2);
	set_task(1.0,"respawn_player",id);
}
} 
public respawn_player(id)	//thx sniffer
{     
if(is_user_connected(id))
	ExecuteHamB(Ham_CS_RoundRespawn, id);     //let's respawn player
}
 
public task_give(id)
{
	if (!is_user_alive(id))
		return;
	strip_user_weapons(id);
	new l_cvar_weapon;
	if(get_cvar_num("amx_warmup_weapon") == 27)
	{
		l_cvar_weapon = random_num(1, 26);
	}
	else
	{
		l_cvar_weapon = get_cvar_num("amx_warmup_weapon");
	}
	switch(l_cvar_weapon)
	{
		case 1 : 
		{
			//now, we have to give weapons that we promised earlier
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_p228");
			cs_set_user_bpammo(id, CSW_P228, 52);
		}
		case 2 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_scout");
			cs_set_user_bpammo(id, CSW_SCOUT, 90);
		}
		case 3 :
		{
			give_item(id, "weapon_hegrenade");
			cs_set_user_bpammo(id, CSW_HEGRENADE, 100);
		}
		case 4 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_xm1014");
			cs_set_user_bpammo(id, CSW_XM1014, 32);
		}
		case 5 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_mac10");
			cs_set_user_bpammo(id, CSW_MAC10, 100);
		}
		case 6 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_aug");
			cs_set_user_bpammo(id,CSW_AUG, 90);
		}
		case 7 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_elite");
			cs_set_user_bpammo(id, CSW_ELITE, 120);
		}
		case 8 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_fiveseven");
			cs_set_user_bpammo(id, CSW_FIVESEVEN, 100);
		}
		case 9 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0) ;
			give_item(id, "weapon_ump45");
			cs_set_user_bpammo(id, CSW_UMP45, 100);
 
		}
		case 10 :
		{
			give_item(id, "weapon_sg550");
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			cs_set_user_bpammo(id, CSW_SG550, 90);
		}
		case 11 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_galil");
			cs_set_user_bpammo(id, CSW_GALIL, 90);
		}
		case 12 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_famas");
			cs_set_user_bpammo(id, CSW_FAMAS, 90);
		}
		case 13 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			cs_set_user_bpammo(id, CSW_USP, 100);
		}
		case 14 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_glock18");
			cs_set_user_bpammo(id, CSW_GLOCK18, 120);
		}
		case 15 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_awp");
			cs_set_user_bpammo(id,CSW_AWP, 30);
		}
		case 16 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_mp5navy");
			cs_set_user_bpammo(id, CSW_MP5NAVY, 120);
		}
		case 17 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_m249");
			cs_set_user_bpammo(id, CSW_M249, 200);
		}
		case 18 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_m3");
			cs_set_user_bpammo(id, CSW_M3, 32);
		}
		case 19 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_M4A1, 90);
		}
		case 20 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_tmp");
			cs_set_user_bpammo(id, CSW_TMP, 120);
 
		}
		case 21 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_g3sg1");
			cs_set_user_bpammo(id, CSW_G3SG1, 90);
		}
		case 22 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_deagle");
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
		}
		case 23 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0); 
			give_item(id, "weapon_sg552");
			cs_set_user_bpammo(id, CSW_SG552, 90);
		}
		case 24 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_AK47, 90);
		}
		case 25 :
		{
 
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_p90");
			cs_set_user_bpammo(id, CSW_P90, 100);
 
		}
		case 26 :
		{
			cs_set_user_armor (id, 100, CS_ARMOR_VESTHELM);
			cs_set_user_money (id , 0);
			give_item(id, "weapon_knife");
		}
	}
}
public HamTouchPre(weapon)
{
	if(g_is_warmup)
	{
	return HAM_SUPERCEDE;
}
	return HAM_IGNORED;
}
public handle_drop(id)
{
	if(g_is_warmup)
	{
	return PLUGIN_HANDLED;
}
	return PLUGIN_CONTINUE;
}
public plugin_precache() 
{
	precache_sound("misc/sound_name.wav");
	//precache_sound("misc/sound_name.mp3");//MP3 version
}
 

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