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 130027901710721 dodana przez Muzzi, 16.03.2011 13:36
Typ:


Xp Mod
130027901710721
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.
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <colorchat>
#include <fun>
 
#define MAXCLASSES 8
#define PREFIX	"CsStrefa"
 
#define ZMIANAMENU_KEYS		MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_0
 
new const LEVELS[20] = { 
	100,
	200,
	500,
	750,
	1000,
	1200,
	1400,
	1600,
	1800,
	2000,
	2200,
	2500,
	2800,
	3100,
	3500,
	4800,
	5600,
	6400,
	7800,
	8900
}
 
new iExp[33],iLvl[33],iClass[33];
new cKill,g_vault;
new gmsgStatusText;
new doswiadczenie_za_bombe;
new podkladajacy;
new rozbrajajacy;
new attacker;
 
new const CLASSES[MAXCLASSES][] = {
	"Brak",
	"Komandos",
	"Snajper",
	"Wojownik",
	"Ogar",
	"Szturmowiec",
	"SWAT",
	"Rambo"
}
 
public plugin_init()
{
	register_plugin("EXP", "1.0", "Flyen & Harsay & Kruszynka");
 
	register_event("DeathMsg", "EventSmierci", "a");
 
	gmsgStatusText = get_user_msgid("StatusText")
 
	g_vault = nvault_open("xp");
	cKill = register_cvar("amx_exp_kill", "20");
	doswiadczenie_za_bombe = register_cvar("amx_exp_bomb", "10")
	register_logevent("BombaPodlozona", 3, "2=Planted_The_Bomb");
	register_event("SendAudio", "BombaRozbrojona", "a", "2&%!MRAD_BOMBDEF");
	register_event("BarTime", "RozbrajaBombe", "be", "1=10", "1=5")
	register_clcmd("say /klasa", "cmdZmianaKlasy")
	register_clcmd("say_team /klasa", "cmdZmianaKlasy")
 
	register_menues();
}
 
public register_menues()
{
	register_menu("ZmianaMenu", ZMIANAMENU_KEYS, "handleZmianaKlasy");
}
 
public EventSmierci()
{
	if(iClass[attacker] == 0)
		return PLUGIN_CONTINUE
	new iKiller = read_data(1);
	new iVictim = read_data(2);     
	new gNumExp = get_pcvar_num(cKill);
 
	new Kid[32],Vid[32];
	get_user_name(iKiller, Kid, 31);
	get_user_name(iVictim, Vid, 31);        
	if(get_user_team(iKiller) != get_user_team(iVictim)) 
	{
		iExp[iKiller] += gNumExp;
		ColorChat(iKiller, GREEN, "[%s]^x01 Dostales^x04 %d^x01 expa za zabicie gracza^x04 %s", PREFIX, gNumExp, Vid);
	}
 
	SprawdzPoziom(iKiller);
	Zapisz(iKiller);
	return PLUGIN_CONTINUE;
}
 
public client_putinserver(id)
{
	Wczytaj(id);
	set_task(2.0, "write_hud",id,_,_, "b")
}
 
public client_disconnect(id)
{
	Zapisz(id);
}
 
public Zapisz(id)
{
	new NameID[32];
	get_user_name(id,NameID,31);
 
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s-Mod",NameID);
	format(vaultdata,255,"%i#%i#",iExp[id], iLvl[id]);
	nvault_set(g_vault,vaultkey,vaultdata);
	return PLUGIN_CONTINUE;
}
 
public Wczytaj(id)
{
	new NameID[32];
	get_user_name(id,NameID,31);
 
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s-Mod",NameID);
	format(vaultdata,255,"%i#%i#",iExp[id], iLvl[id]);
	nvault_get(g_vault,vaultkey,vaultdata,255);
	replace_all(vaultdata, 255, "#", " ");
 
	new PEXP[32], PLEV[32]; 
	parse(vaultdata, PEXP, 31, PLEV, 31);
	iExp[id] = str_to_num(PEXP);
	iLvl[id] = str_to_num(PLEV);   
	return PLUGIN_CONTINUE;
}
 
public SprawdzPoziom(id) 
{
	while(iExp[id] >= LEVELS[iLvl[id]]){
		ColorChat(id, GREEN, "[%s]^x01 Gratulacje! Awansowales na kolejny poziom!", PREFIX)
		iLvl[id] += 1
	}
	Zapisz(id);
}
 
public write_hud(id)
{
	if(!is_user_connected(id)) return;
	new text[512]
	format(text,511,"Exp: %i Level: %i/20 Klasa: %s",iExp[id], iLvl[id], CLASSES[iClass[id]])
	message_begin(MSG_ONE,get_user_msgid("StatusText"),{0,0,0}, id)
	write_byte(0)
	write_string(text)
	message_end() 
}
public cmdZmianaKlasy(id) 
{
	static format_menu[954];
 
	new len = formatex(format_menu, sizeof(format_menu) - 1,	"\r[%s]\y Wybierz klase:^n", PREFIX);
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r1.\w Komandos");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r2.\w Snajper");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r3.\w Wojownik");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r4.\w Ogar");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r5.\w Szturmowiec");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r6.\w SWAT");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n\r7.\w Rambo");
 
	len += format(format_menu[len], sizeof(format_menu) - len - 1,	"^n^n^n^n\r0.\y Wyjscie");
 
	show_menu(id, ZMIANAMENU_KEYS, format_menu, -1, "ZmianaMenu");
 
	return PLUGIN_HANDLED;
}
 
public handleZmianaKlasy(id) 
{
	switch(iClass[id])
	{
		case 0: 
		{	
			give_item(id, "weapon_awp");
			ColorChat(id, GREEN, "[%s]^x01 Dostajesz: m4a1, ak-47, deagla i 140hp na start", PREFIX)
		}
		case 1: 
		{		
			give_item(id, "weapon_awp");
		}
		case 2: 
		{		
			give_item(id, "weapon_awp");
		}
		case 3: 
		{		
			give_item(id, "weapon_awp");
		}
		case 4: 
		{		
			give_item(id, "weapon_awp");
		}
		case 5: 
		{		
			give_item(id, "weapon_awp");
		}
		case 6: 
		{		
			give_item(id, "weapon_awp");
		}
	}
}
 
public RozbrajaBombe(id){
	rozbrajajacy = id;
}
 
public BombaPodlozona()
{
	new Players[32], playerCount, id;
	get_players(Players, playerCount, "aeh", "TERRORIST");
 
	if(get_playersnum() > 1)
	{
		iExp[podkladajacy] += get_pcvar_num(doswiadczenie_za_bombe);
		for (new i=0; i<playerCount; i++) 
		{                       
			if(i != podkladajacy)
			{
				iExp[id] += get_pcvar_num(cKill);
				ColorChat(id, GREEN, "[%s]^x01 Dostales^x04 %i^x01 expa za podlozenie bomby przez twoj team", PREFIX, get_pcvar_num(cKill));
			}
			else
			{
				iExp[id] += get_pcvar_num(doswiadczenie_za_bombe);
				ColorChat(id, GREEN, "[%s]^x01 Dostales^x04 %i^x01 expa za podlozenie bomby", PREFIX, get_pcvar_num(doswiadczenie_za_bombe));
			}
			SprawdzPoziom(id);
		}
	}
}
 
public BombaRozbrojona()
{
	new Players[32], playerCount, id;
	get_players(Players, playerCount, "aeh", "CT");
 
	iExp[rozbrajajacy] += get_pcvar_num(doswiadczenie_za_bombe);
	for (new i=0; i<playerCount; i++) 
	{
		if(i != rozbrajajacy)
		{
			iExp[id] += get_pcvar_num(cKill);
			ColorChat(id, GREEN, "[%s]^x01 Dostales^x04 %i^x01 expa za rozbrojenie bomby przez twoj team", PREFIX, get_pcvar_num(cKill));
		}
		else
		{
			iExp[id] += get_pcvar_num(doswiadczenie_za_bombe);
			ColorChat(id, GREEN, "[%s]^x01 Dostales^x04 %i^x01 expa za rozbrojenie bomby", PREFIX, get_pcvar_num(doswiadczenie_za_bombe));
		}
		SprawdzPoziom(id);
	}
}