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 13168074189904 dodana przez Stachuu :D ??, 23.09.2011 20:50
Typ:


13168074189904
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.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
985.
986.
987.
988.
989.
990.
991.
992.
993.
994.
995.
996.
997.
998.
999.
1000.
1001.
1002.
1003.
1004.
1005.
1006.
1007.
1008.
1009.
1010.
1011.
1012.
1013.
1014.
1015.
1016.
1017.
1018.
1019.
1020.
1021.
1022.
1023.
1024.
1025.
1026.
1027.
1028.
1029.
1030.
1031.
1032.
1033.
1034.
1035.
1036.
1037.
1038.
1039.
1040.
1041.
1042.
1043.
1044.
1045.
1046.
1047.
1048.
1049.
1050.
1051.
1052.
1053.
1054.
1055.
1056.
1057.
1058.
1059.
1060.
1061.
1062.
1063.
1064.
1065.
1066.
1067.
1068.
1069.
1070.
1071.
1072.
1073.
1074.
1075.
1076.
1077.
1078.
1079.
1080.
1081.
1082.
1083.
1084.
1085.
1086.
1087.
1088.
1089.
1090.
1091.
1092.
1093.
1094.
1095.
1096.
1097.
1098.
1099.
1100.
1101.
1102.
1103.
1104.
1105.
1106.
1107.
1108.
1109.
1110.
1111.
1112.
1113.
1114.
1115.
1116.
1117.
1118.
1119.
1120.
1121.
1122.
1123.
1124.
1125.
1126.
1127.
1128.
1129.
1130.
1131.
1132.
1133.
1134.
1135.
1136.
1137.
1138.
1139.
1140.
1141.
1142.
1143.
1144.
1145.
1146.
1147.
1148.
1149.
1150.
1151.
1152.
1153.
1154.
1155.
1156.
1157.
1158.
1159.
1160.
1161.
1162.
1163.
1164.
1165.
1166.
1167.
1168.
1169.
1170.
1171.
1172.
1173.
1174.
1175.
1176.
1177.
1178.
1179.
1180.
1181.
1182.
1183.
1184.
1185.
1186.
1187.
1188.
1189.
1190.
1191.
1192.
1193.
1194.
1195.
1196.
1197.
1198.
1199.
1200.
1201.
1202.
1203.
1204.
1205.
1206.
1207.
1208.
1209.
1210.
1211.
1212.
1213.
1214.
1215.
1216.
1217.
1218.
1219.
1220.
1221.
1222.
1223.
1224.
1225.
1226.
1227.
1228.
1229.
1230.
1231.
1232.
1233.
1234.
1235.
1236.
1237.
1238.
1239.
1240.
1241.
1242.
1243.
1244.
1245.
1246.
1247.
1248.
1249.
1250.
1251.
1252.
1253.
1254.
1255.
1256.
1257.
1258.
1259.
1260.
1261.
1262.
1263.
1264.
1265.
1266.
1267.
1268.
1269.
1270.
1271.
1272.
1273.
1274.
1275.
1276.
1277.
1278.
1279.
1280.
1281.
1282.
1283.
1284.
1285.
1286.
1287.
1288.
1289.
1290.
1291.
1292.
1293.
1294.
1295.
1296.
1297.
1298.
1299.
1300.
1301.
1302.
1303.
1304.
1305.
1306.
1307.
1308.
1309.
1310.
1311.
1312.
1313.
1314.
1315.
1316.
1317.
1318.
1319.
1320.
1321.
1322.
1323.
1324.
1325.
1326.
1327.
1328.
1329.
1330.
1331.
1332.
1333.
1334.
1335.
1336.
1337.
1338.
1339.
1340.
1341.
1342.
1343.
1344.
1345.
1346.
1347.
1348.
1349.
1350.
1351.
1352.
1353.
1354.
1355.
1356.
1357.
1358.
1359.
1360.
1361.
1362.
1363.
1364.
1365.
1366.
1367.
1368.
1369.
1370.
1371.
1372.
1373.
1374.
1375.
1376.
1377.
1378.
1379.
1380.
1381.
1382.
1383.
1384.
1385.
1386.
1387.
1388.
1389.
1390.
1391.
1392.
1393.
1394.
1395.
1396.
1397.
1398.
1399.
1400.
1401.
1402.
1403.
1404.
1405.
1406.
1407.
1408.
1409.
1410.
1411.
1412.
1413.
1414.
1415.
1416.
1417.
1418.
1419.
1420.
1421.
1422.
1423.
1424.
1425.
1426.
1427.
1428.
1429.
1430.
1431.
1432.
1433.
1434.
1435.
1436.
1437.
1438.
1439.
1440.
1441.
1442.
1443.
1444.
1445.
1446.
1447.
1448.
1449.
1450.
1451.
1452.
1453.
1454.
1455.
1456.
1457.
1458.
1459.
1460.
1461.
1462.
1463.
1464.
1465.
1466.
1467.
1468.
1469.
1470.
1471.
1472.
1473.
1474.
1475.
1476.
1477.
1478.
1479.
1480.
1481.
1482.
1483.
1484.
1485.
1486.
1487.
1488.
1489.
1490.
1491.
1492.
1493.
1494.
1495.
1496.
1497.
1498.
1499.
1500.
1501.
1502.
1503.
1504.
1505.
1506.
1507.
1508.
1509.
1510.
1511.
1512.
1513.
1514.
1515.
1516.
1517.
1518.
1519.
1520.
1521.
1522.
1523.
1524.
1525.
1526.
1527.
1528.
1529.
1530.
1531.
1532.
1533.
1534.
1535.
1536.
1537.
1538.
1539.
1540.
1541.
1542.
1543.
1544.
1545.
1546.
1547.
1548.
1549.
1550.
1551.
1552.
1553.
1554.
1555.
1556.
1557.
1558.
1559.
1560.
1561.
1562.
1563.
1564.
1565.
1566.
1567.
1568.
1569.
1570.
1571.
1572.
1573.
1574.
1575.
1576.
1577.
1578.
1579.
1580.
1581.
1582.
1583.
1584.
1585.
1586.
1587.
1588.
1589.
1590.
1591.
1592.
1593.
1594.
1595.
1596.
1597.
1598.
1599.
1600.
1601.
1602.
1603.
1604.
1605.
1606.
1607.
1608.
1609.
1610.
1611.
1612.
1613.
1614.
1615.
1616.
1617.
1618.
1619.
1620.
1621.
1622.
1623.
1624.
1625.
1626.
1627.
1628.
1629.
1630.
1631.
1632.
1633.
1634.
1635.
1636.
1637.
1638.
1639.
1640.
/* Start 21 Sierpien */
 
/* przerwano 24 Sierpien */
 
#include <amxmodx>
#include <amxmisc>
 
#include <engine>
#include <fakemeta> 
#include <csx>
#include <cstrike>
 
#include <fun>
#include <fakemeta_util>
#include <colorchat> 
#include <hamsandwich> 
#include <nvault>
 
#pragma tabsize 0
 
#define PLUGIN "Gothic II Mod"
#define VERSION "1.0"
#define AUTHOR "Stachu Mroz ;]"
 
#define MAX 20
#define csdm_task 444
 
//////valut/////
new g_exp
new g_zielsko
new g_bron
new g_mikstury
new g_umie
//////exp-doswiadczenie/////
new iExp[33]
new iLvl[33]
new iKim[33]
new player_rozdzial[33]
new player_krag[33]
new player_pkt[33]
new sila[33]
new zrecznosc[33]
new zycie[33]
new mana[33],aktualna_mana[33]
new last_update_xp[33]
new Float:last_update_perc[33]
 
new const LEVELS[16] = {
	0, 100, 200, 400,800,1500,2300,3100,4000,5000,6400,7900,9000,11000,15000,33333
}
/////nazwy gildie poziomy itp//////
 
new klasy[3][22] = {"Brak Sciezki","Nowicjusz","Maly ziom"}
/////enum dla poziomow////
 
enum { NONE = 0, Nowicjusz, xxx}
/////inne////
new gmsgStatusText
new g_msgDeathMsg
new menu_option[33],menu_przydziel[33]
////przypisywanie klawiszy slot1 itp////
new ma_funkcje1[33],ma_funkcje2[33],ma_funkcje3[33],ma_funkcje4[33],ma_funkcje5[33]
////ziola////
new rdes[33],l_jag[33],r_lecz[33],g_jag[33],z_ziele[33],o_korz[33],s_korz[33],s_kru[33],menzurka[33],alchemia[33]
////mikstury////
new m_zycia[33],m_mana[33],m_spid[33]
////bronie/////
new tryb_broni[33]
new bron1[33],bron2[33],bron3[33],bron4[33],id_broni[33]
new moja_bron[33],dmg_bron[33]
 
new lista_broni[][]={"Brak",
	"Sztylet",//1
	"Pogrzebacz",//2
	"Sierp",//3
	"Laska",//4
	"Laga",//5
	"Sluga Wiatru",//6
	"Kiepski Krotki Miecz",//7
	"Krotki Miecz Strazy",//8
	"Mlot Kowalski",//9
	"Topor",//10
	"Topor Drwala",//11
	"Zardzewialy Krotki Miecz",//12
	"Noz na wilki",//13
	"Mala Kosa",//14
	"Maczuga z Kolcami",//15
	"Krotki Miecz",//16
	"Miecz",//17
	"Gruby Krotki Miecz",//18
	"Palka z kolcami",//19
	"Kilof",//20
	"Wilczy Kiel",//21
	"Pika Bojowa",//22
	"Palka Bojowa",//23
	"Dobry Krotki Miecz",//24
	"Kostur Sedziego",//25
	"Kiepski Miecz",//26
	"Kiepski Tasak",//27
	"Kiepski Szeroki Miecz",//28
	"Miecz Arlika",//29
	"Zardzewialy Topor",//30
	"Zardzewialy Miecz Dwureczny",//31
	"Ciezka Palka z Kolcami",//32
	"Halabarda",//33
	"Magiczna Rozdzka",//34
	"Mlot Wojeny",//35
	"Kiepski Dlugi Miecz",//36
	"Topor Marynarski",//37
	"Piracki Kordelas",//38
	"Lekki Orkowy Topor",//39
	"Topor Pokladowy",//40
	"Stara Maczeta"
}
new sila_do_broni[]={
	0,5,5,5,5,10,10,25,10,10,10,
	10,50,30,30,10,10,10,30,20,30,
	10,22,15,50,25,35,50,40,50,30,
	40,50,70,55,25,55,65,60,60,70,
	60,60
}
new dmg_broni[112]={
	0,5,5,7,8,8,10,15,20,20,  ///10/
	20,20,50,30,30,25,25,16,40,40,//20/
	40,30,45,30,50,50,50,40,40,60,///30/
	30,40,50,70,55,55,55,65,60,65,
	50,60,60,60,60,60,65,30,70,70,
	70,75,70,80,100,35,35,60,60,60,
	40,90,60,90,80,80,70,75,80,90,
	90,110,80,60,50,100,80,85,100,105,///80
	105,110,110,115,60,100,110,80,100,100,///90
	105,130,120,125,120,140,135,145,120,120,
	120,150,150,140,200,190,140,160,160,160,
160,180}
 
new cena_broni[112]={
	0,5,5,10,10,5,5,25,250,250, ///10
	200,200,500,30,250,50,60,450,50,450, ///10
	300,550,500,500,750,600,40,40,750,50,///10
	40,50,700,550,850,550,650,600,700,10,///10
	600,600,900,900,600,950,100,700,700,1000,///10
	750,700,700,100,300,450,60,60,15,50,///10
	900,1000,900,800,25,20,1050,900,850,900,///10
	110,25,750,600,1200,800,850,1100,1100,1050,///10
	1100,1100,1150,120,130,1100,1200,2000,1200,1100,///10
	1300,1200,1250,1300,1400,1350,1450,1500,2000,3000,///10
	1500,1500,1500,3000,2900,4000,4000,1800,1800,///104000,2100
}
new tryb_bron[112]={
	1,1,1,1,1,1,1,1,1,1,
	1,1,2,1,1,1,1,1,1,1,
	1,2,1,2,1,1,1,1,1,1,
	1,2,2,1,2,2,1,1,1,1,
	2,1,1,2,2,1,2,1,2,2,
	2,2,2,2,1,1,1,2,2,2,
	2,1,2,2,2,2,2,2,1,1,
	1,1,2,1,1,1,2,1,1,2,
	2,1,1,2,2,2,1,1,1,1,
	2,1,1,1,1,2,2,2,2,2,
1,2,2,2,2,2,1,2,2,1,2,2}
////sprite.////
 
new sprite_white = 0
 
public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
 
	g_exp = nvault_open("Exp")
	g_zielsko = nvault_open("Ziolo")
	g_bron = nvault_open("Bron")
	g_mikstury = nvault_open("Poty")
	g_umie = nvault_open("Umiejetnosci")
 
	register_clcmd("say eq","info_eq");
	register_clcmd("say /eq","info_eq");
	register_clcmd("say /menu","showmenu");
	register_clcmd("fullupdate", "BlokujKomende");
	register_clcmd("cl_autobuy", "BlokujKomende");
	register_clcmd("cl_rebuy", "BlokujKomende");
	register_clcmd("cl_setautobuy","BlokujKomende");
	register_clcmd("rebuy", "BlokujKomende");
	register_clcmd("autobuy", "BlokujKomende");
	register_clcmd("glock", "BlokujKomende");
	register_clcmd("usp", "BlokujKomende");
	register_clcmd("p228", "BlokujKomende");
	register_clcmd("deagle", "BlokujKomende");
	register_clcmd("elites", "BlokujKomende");
	register_clcmd("fn57", "BlokujKomende");
	register_clcmd("m3", "BlokujKomende");
	register_clcmd("XM1014", "BlokujKomende");
	register_clcmd("mac10", "BlokujKomende");
	register_clcmd("tmp", "BlokujKomende");
	register_clcmd("mp5", "BlokujKomende");
	register_clcmd("ump45", "BlokujKomende");
	register_clcmd("p90", "BlokujKomende");
	register_clcmd("galil", "BlokujKomende");
	register_clcmd("ak47", "BlokujKomende");
	register_clcmd("scout", "BlokujKomende");
	register_clcmd("sg552", "BlokujKomende");
	register_clcmd("awp", "BlokujKomende");
	register_clcmd("g3sg1", "BlokujKomende");
	register_clcmd("famas", "BlokujKomende");
	register_clcmd("m4a1", "BlokujKomende");
	register_clcmd("bullpup", "BlokujKomende");
	register_clcmd("sg550", "BlokujKomende");
	register_clcmd("m249", "BlokujKomende");
	register_clcmd("shield", "BlokujKomende");
	register_clcmd("hegren", "BlokujKomende");
	register_clcmd("sgren", "BlokujKomende");
	register_clcmd("flash", "BlokujKomende");
	register_clcmd("vest", "BlokujKomende");
	register_clcmd("vesthelm", "BlokujKomende");
 
	register_clcmd("f1", "klawisz1");
	register_clcmd("f2", "klawisz2");
	register_clcmd("f3", "klawisz3");
	register_clcmd("f4", "klawisz4");
	register_clcmd("f5", "klawisz5");
 
	register_menucmd(register_menuid("Opcje"), 1023, "option_menu")
	register_menucmd(register_menuid("Punkty Nauki"), 1023, "skill_menu")
 
	gmsgStatusText = get_user_msgid("StatusText")
	g_msgDeathMsg = get_user_msgid("DeathMsg")
 
	set_msg_block( g_msgDeathMsg, BLOCK_SET );
 
	register_event("DeathMsg", "DeathMsg", "a");
	RegisterHam(Ham_TakeDamage, "player","fwTakeDamage",0)
	RegisterHam(Ham_Spawn, "player", "ustaw_hp", 1);	
	register_forward(FM_PlayerPreThink, "PlayerPreThink") 	
 
	set_task(1.0, "UpdateHUD",0,"",0,"b")
}
public plugin_precache()
{ 
	sprite_white = precache_model("sprites/white.spr") 
}
 
public client_connect(id){
	Wczytaj(id)
	WczytajZ(id)
	WczytajB(id)
	WczytajM(id)
	WczytajU(id)
	set_task(5.0,"aktywuj_bron",id)
}
/*
public client_authorized(id)
{
	client_cmd(id,"bind ^"f1^" ^"f1^"")
	client_cmd(id,"bind ^"f2^" ^"f2^"")
	client_cmd(id,"bind ^"f3^" ^"f3^"")
	client_cmd(id,"bind ^"f4^" ^"f4^"")
	client_cmd(id,"bind ^"f5^" ^"f5^"")
}*/
public client_disconnect(id)
{	
	Zapisz(id)
	ZapiszZ(id)
	ZapiszB(id)
	ZapiszM(id)
	ZapiszU(id)
	reset_all(id)
}
public reset_all(id)
{
	iExp[id] = 0
	iLvl[id] = 0
	iKim[id] = 0
	player_rozdzial[id] = 0
	player_krag[id] = 0
	player_pkt[id] = 0
	rdes[id] = 0
	zycie[id] = 0
	mana[id] = 0
	moja_bron[id] = 0
	l_jag[id] = 0
	r_lecz[id] = 0
	g_jag[id] = 0
	z_ziele[id] = 0
	o_korz[id] = 0
	s_korz[id] = 0
	s_kru[id] = 0
	bron1[id] = 0
	bron2[id] = 0
	bron3[id] = 0
	bron4[id] = 0
	m_zycia[id]=0
	m_mana[id]=0
	m_spid[id]=0
	dmg_bron[id] = 0
	menzurka[id] = 0
}
////////////////////////////////////nvalut////////////////////////////
public Zapisz(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GT",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#",iExp[id], iLvl[id], iKim[id] ,player_rozdzial[id],player_krag[id],player_pkt[id],sila[id],zrecznosc[id],zycie[id],mana[id],moja_bron[id])
	nvault_set(g_exp,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}
public Wczytaj(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GT",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#%i#",iExp[id], iLvl[id], iKim[id] ,player_rozdzial[id],player_krag[id],player_pkt[id],sila[id],zrecznosc[id],zycie[id],mana[id],moja_bron[id])
	nvault_get(g_exp,vaultkey,vaultdata,255)
 
	replace_all(vaultdata, 255, "#", " ")
 
	new playerxp[32], playerlevel[32], playerkim[32], playerroz[32], playerkra[32], playerpkt[32], si[32], zr[32], zyc[32],man[32],bro[32]
 
	parse(vaultdata, playerxp, 31, playerlevel, 31, playerkim, 31, playerroz, 31, playerkra, 31, playerpkt, 31, si, 31, zr, 31, zyc, 31, man, 31, bro, 31)
 
	iExp[id] = str_to_num(playerxp)
	iLvl[id] = str_to_num(playerlevel)
	iKim[id] = str_to_num(playerkim)
	player_rozdzial[id] = str_to_num(playerroz)
	player_krag[id] = str_to_num(playerkra)
	player_pkt[id] = str_to_num(playerkra)
	sila[id] = str_to_num(si)
	zrecznosc[id] = str_to_num(zr)
	zycie[id] = str_to_num(zyc)
	mana[id] = str_to_num(man)
	moja_bron[id] = str_to_num(bro)
 
	return PLUGIN_CONTINUE
}
//////////////////////////////////////
public ZapiszZ(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTZ",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#",rdes[id],l_jag[id],r_lecz[id],g_jag[id],z_ziele[id],o_korz[id],s_korz[id],s_kru[id])
	nvault_set(g_zielsko,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}
public WczytajZ(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTZ",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#",rdes[id],l_jag[id],r_lecz[id],g_jag[id],z_ziele[id],o_korz[id],s_korz[id],s_kru[id])
	nvault_get(g_zielsko,vaultkey,vaultdata,255)
 
	replace_all(vaultdata, 255, "#", " ")
 
	new bez1[32], jag[32], lecz1[32], lecz2[32], ziele[32], korz[32], korz2[32], kru[32]
 
	parse(vaultdata, bez1, 31, jag, 31, lecz1, 31, lecz2, 31, ziele, 31, korz, 31, korz2, 31, kru, 31)
 
	rdes[id] = str_to_num(bez1)
	l_jag[id] = str_to_num(jag)
	r_lecz[id] = str_to_num(lecz1)
	g_jag[id] = str_to_num(lecz2)
	z_ziele[id] = str_to_num(ziele)
	o_korz[id] = str_to_num(korz)
	s_korz[id] = str_to_num(korz2)
	s_kru[id] = str_to_num(kru)
 
	return PLUGIN_CONTINUE
}
//////////////////////////////////////
public ZapiszB(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#",bron1[id],bron2[id],bron3[id],bron4[id])
	nvault_set(g_bron,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}
public WczytajB(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#",bron1[id],bron2[id],bron3[id],bron4[id])
	nvault_get(g_bron,vaultkey,vaultdata,255)
 
	replace_all(vaultdata, 255, "#", " ")
 
	new bez1[32], jag[32], lecz1[32], lecz2[32]
 
	parse(vaultdata, bez1, 31, jag, 31, lecz1, 31, lecz2, 31)
 
	bron1[id] = str_to_num(bez1)
	bron2[id] = str_to_num(jag)
	bron3[id] = str_to_num(lecz1)
	bron4[id] = str_to_num(lecz2)
 
	return PLUGIN_CONTINUE
}
//////////////////////////////////////
public ZapiszM(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#",m_zycia[id],m_mana[id],m_spid[id],ma_funkcje1[id],ma_funkcje2[id],ma_funkcje3[id],ma_funkcje4[id],ma_funkcje5[id])
	nvault_set(g_mikstury,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}
public WczytajM(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#%i#%i#%i#%i#%i#%i#",m_zycia[id],m_mana[id],m_spid[id],ma_funkcje1[id],ma_funkcje2[id],ma_funkcje3[id],ma_funkcje4[id],ma_funkcje5[id])
	nvault_get(g_mikstury,vaultkey,vaultdata,255)
 
	replace_all(vaultdata, 255, "#", " ")
 
	new zyc[32], man[32], spi[32], f1[32], f2[32], f3[32], f4[32], f5[32]
 
	parse(vaultdata, zyc, 31, man, 31, spi, 31, f1, 31, f2, 31, f3, 31, f4, 31, f5, 31)
 
	m_zycia[id] = str_to_num(zyc)
	m_mana[id] = str_to_num(man)
	m_spid[id] = str_to_num(spi)
	ma_funkcje1[id] = str_to_num(f1)
	ma_funkcje2[id] = str_to_num(f2)
	ma_funkcje3[id] = str_to_num(f3)
	ma_funkcje4[id] = str_to_num(f4)
	ma_funkcje5[id] = str_to_num(f5)	
	return PLUGIN_CONTINUE
}
//////////////////////////////////////
public ZapiszU(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#",alchemia[id],menzurka[id])
	nvault_set(g_umie,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}
public WczytajU(id)
{
	new AuthID[35]
 
	get_user_name(id,AuthID,34)
 
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-GTB",AuthID)
	format(vaultdata,255,"%i#%i#",alchemia[id],menzurka[id])
	nvault_get(g_umie,vaultkey,vaultdata,255)
 
	replace_all(vaultdata, 255, "#", " ")
 
	new zyc[32],men[32]
 
	parse(vaultdata, zyc, 31, men ,31)
 
	alchemia[id] = str_to_num(zyc)	
	menzurka[id] = str_to_num(men)
 
	return PLUGIN_CONTINUE
}
/* ==================================================================================================== */
public DeathMsg(id)
{
	new kid = read_data(1)
	new vid = read_data(2)
	new weaponname[20] 
	new headshot = read_data(3) 
	read_data(4,weaponname,31) 
 
	if (is_user_connected(kid) && is_user_connected(vid) && get_user_team(kid) != get_user_team(vid))
	{
		award_kill(kid,vid)
		daj_mu_item(kid)
		Zapisz(vid)
		show_deadmessage(kid,vid,headshot,weaponname)
 
		set_task(3.0,"respawn_player",vid+csdm_task);
	}
}
/* ==================================================================================================== */
public show_deadmessage(killer_id,victim_id,headshot,weaponname[])
{
	if (!(killer_id==victim_id && !headshot && equal(weaponname,"world")))
	{
		message_begin( MSG_ALL, g_msgDeathMsg,{0,0,0},0)
		write_byte(killer_id)
		write_byte(victim_id)
		write_byte(headshot)
		write_string(weaponname)
		message_end()
	}
}
/* ==================================================================================================== */
public award_kill(killer_id,victim_id)
{
	if (!is_user_connected(killer_id) || !is_user_connected(victim_id))
		return PLUGIN_CONTINUE
 
	new xp_award = 100
 
	if (iExp[killer_id]<iExp[victim_id]) 
		xp_award+=5
 
	daj_xp(killer_id,xp_award)
	ColorChat(killer_id, GREEN, "^x04[Exp]^x01 + %i expa",xp_award)
 
	return PLUGIN_CONTINUE	
}
public daj_xp(id,amount)
{	
	if(iExp[id]+amount!=0 && get_playersnum()>1){
 
		iExp[id]+=amount
 
		if (iExp[id] >= LEVELS[iLvl[id]])
		{
			iLvl[id]+=1
			player_pkt[id]+=10
			zycie[id]+=12
			Zapisz(id)
		}
		if (iExp[id] < LEVELS[iLvl[id]-1])
		{
			iLvl[id]-=1
			Zapisz(id)
		}
	}
}
/* ==================================================================================================== */
public lvl_hud(id)
{
	if (iLvl[id] == 0)
		iLvl[id] = 1
	new tpstring[1024],pkt[50]
 
	new Float:xp_now
	new Float:xp_need
	new Float:perc
	if (last_update_xp[id] == iExp[id])
	{
		perc = last_update_perc[id]
	}
	else
	{
		//Calculate percentage of xp required to level
		if (iLvl[id] == 1)
		{
			xp_now = float(iExp[id])
			xp_need = float(LEVELS[iLvl[id]])
			perc = xp_now*100.0/xp_need
		}
		else
		{
			xp_now = float(iExp[id])-float(LEVELS[iLvl[id]-1])
			xp_need = float(LEVELS[iLvl[id]])-float(LEVELS[iLvl[id]-1])
			perc = xp_now*100.0/xp_need
		}
	}
 
	format(pkt,65,"^nWolne Pkt Nauki: %i",player_pkt[id])
	last_update_xp[id] = iExp[id]
	last_update_perc[id] = perc
	new hapek = get_user_health(id);
 
	set_hudmessage(0, 255, 0, 0.02, 0.23, 0, 6.0, 1.0);
	show_hudmessage(id, "Lvl: %i (%0.0f%s)^nBron: %s",iLvl[id],perc, "%",lista_broni[moja_bron[id]],player_pkt[id]? pkt:"");
 
	format(tpstring,1023,"HP: %i MP: %i %s ",hapek,aktualna_mana[id],klasy[iKim[id]])
 
	message_begin(MSG_ONE,gmsgStatusText,{0,0,0}, id)
	write_byte(0)
	write_string(tpstring) 
	message_end()
 
}
/* ==================================================================================================== */
public UpdateHUD()
{    
	for (new id=0; id < MAX; id++)
	{	
		//If user is not connected, don't do anything
		if (!is_user_connected(id))
			continue
 
		if (is_user_alive(id)) lvl_hud(id)
		else
		{
			//Show info about the player we're looking at
			new index,bodypart 
			get_user_aiming(id,index,bodypart)  
 
			if(index >= 0 && index < MAX && is_user_connected(index) && is_user_alive(index)) 
			{
				new pname[32]
				get_user_name(index,pname,31)
 
				new Msg[512]
				set_hudmessage(255, 255, 255, 0.73, 0.68, 0, 6.0, 3.0)
				format(Msg,511,"Nick: %s^n%i^n%s",
				pname,iLvl[index],klasy[iKim[index]])		
				show_hudmessage(id, Msg)
 
			}
		}
	}
	return PLUGIN_CONTINUE;
}
/* ==================================================================================================== */
public daj_mu_item(id){
	new rodzaj = random_num(1,2);
	switch(rodzaj){
		case 1:
		{
			if(bron4[id] !=0){
				return PLUGIN_HANDLED
			}
			else
			{
				award_bron(id,0)
			}
		}
		case 2:
		{
			award_ziolo(id, 0)
		}
	}
	return PLUGIN_HANDLED
}
/* ==============Ziolo==================*/
public award_ziolo(id, itemnum)
{
	new rannum = random_num(1,6)
	new rf = random_num(1,3)
 
	if (itemnum > 0) rannum = itemnum
	else if (itemnum < 0) return PLUGIN_HANDLED
 
	if (rf == 3 && itemnum == 0)						//We found a rare item			
	{
		award_unique_ziolo(id)	
		rannum = -1
	}
 
	switch(rannum)
	{
		case 1:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Rdes Polny^x01")
			rdes[id]++
		}
		case 2:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Lesna jagode^x01")
			l_jag[id]++
		}
		case 3:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Rosline lecznicza^x01")
			r_lecz[id]++
		}
		case 4:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Zebate Ziele^x01")
			z_ziele[id]++
		}
		case 5:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Ognisty Korzen^x01")
			o_korz[id]++
		}
	}
	return PLUGIN_HANDLED
}
public award_unique_ziolo(id)
{
	new rannum = random_num(1,5)
 
	switch(rannum)
	{
		case 1:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Smoczy Korzen^x01")
			s_korz[id]++
		}
		case 2:
		{
			ColorChat(id, GREEN, "Dostales ^x04 Szczaw Krolewski^x01")
			s_kru[id]++
		}
		case 3:
		{ 
			ColorChat(id, GREEN, "Dostales ^x04 Goblinie jagody^x01")
			g_jag[id]++
		}
	}
}
/* ==============Ziolo==================*/
public award_bron(id, itemnum)
{
	new rannum
	if( 10 > iLvl[id] >= 0){
		rannum = random_num( 1,9 );
	}
	else if( 20 > iLvl[id] >= 10){
		rannum = random_num( 1,17 );	
	}
	else if( 30 > iLvl[id] >= 20){
		rannum = random_num( 1,28 );
	}
	else if( 40 > iLvl[id] >= 30){
		rannum = random_num( 1,40 );
	}
 
	switch(rannum){
		case 6,9,11,17,20,21,25,29,34,35,39:return PLUGIN_HANDLED
		}
 
 
	if (itemnum > 0) rannum = itemnum
	else if (itemnum < 0) return PLUGIN_HANDLED	
 
 
	id_broni[id] = rannum
 
	ColorChat(id, GREEN, "Dostales ^x04 %s^x01",lista_broni[id_broni[id]])
	if(bron1[id] == 0){
		bron1[id] = id_broni[id]
		return PLUGIN_HANDLED
	}
	if(bron2[id] == 0){
		bron2[id] = id_broni[id]
		return PLUGIN_HANDLED
	}
	if(bron3[id] == 0){
		bron3[id] = id_broni[id]
		return PLUGIN_HANDLED
	}
	if(bron4[id] == 0){
		bron4[id] = id_broni[id]
		return PLUGIN_HANDLED
	}
 
	return PLUGIN_HANDLED
}
public info_eq(id)
{
	new path_to_file[64]
	new diabloDir[64]	
	new amxbasedir[64]
	get_basedir(amxbasedir,63)
 
	format(diabloDir,63,"%s/diablo",amxbasedir)
 
	if (!dir_exists(diabloDir))
	{
		new errormsg[512]
		format(errormsg,511,"Blad: Folder %s/diablo nie mogł być znaleziony. Prosze skopiowac ten folder z archiwum do folderu amxmodx",amxbasedir)
		show_motd(id, errormsg, "An error has occured")	
 
	}
 
	format(path_to_file,63,"%s/diablo/item.txt",amxbasedir)
 
	if(file_exists(path_to_file)){
		delete_file(path_to_file)
	}
	new Data[1024];
 
	format(Data,1024,"<html><head><title>Informacje Plecak</title></head>")
	write_file(path_to_file,Data,-1)
 
	format(Data,1024,"<body bgcolor = black><center><b>")
	write_file(path_to_file,Data,-1)
 
	if(bron1[id])
	{
		format(Data,1024,"<font color=white>%s</font><br />",lista_broni[bron1[id]])
		write_file(path_to_file,Data,-1);
	}
	if(bron2[id])
	{
		format(Data,1024,"<font color=white>%s</font><br />",lista_broni[bron2[id]])
		write_file(path_to_file,Data,-1);
	}
	if(bron3[id])
	{
		format(Data,1024,"<font color=white>%s</font><br />",lista_broni[bron3[id]])
		write_file(path_to_file,Data,-1);
	}
	if(bron4[id])
	{
		format(Data,1024,"<font color=white>%s</font><br />",lista_broni[bron4[id]])
		write_file(path_to_file,Data,-1);
	}
	if(m_zycia[id])
	{
		format(Data,1024,"<font color=white>Mikstury Zycia %i</font><br />",m_zycia[id])
		write_file(path_to_file,Data,-1);
	}
	if(m_mana[id])
	{
		format(Data,1024,"<font color=white>Mikstury Many %i</font><br />",m_mana[id])
		write_file(path_to_file,Data,-1);
	}
	if(m_spid[id])
	{
		format(Data,1024,"<font color=white>%s</font><br />",m_spid[id])
		write_file(path_to_file,Data,-1);
	}
	if(rdes[id])
	{
		format(Data,1024,"<font color=white>Rdes: %i</font><br />",rdes[id])
		write_file(path_to_file,Data,-1);
	}
	if(l_jag[id])
	{
		format(Data,1024,"<font color=white>Lesna Jagoda: %i</font><br />",l_jag[id])
		write_file(path_to_file,Data,-1);
	}
	if(r_lecz[id])
	{
		format(Data,1024,"<font color=white>Rosliny Lecznicze: %i</font><br />",r_lecz[id])
		write_file(path_to_file,Data,-1);
	}
	if(g_jag[id])
	{
		format(Data,1024,"<font color=white>Goblinie jagody: %i</font><br />",g_jag[id])
		write_file(path_to_file,Data,-1);
	}
	if(z_ziele[id])
	{
		format(Data,1024,"<font color=white>Zebate Ziele: %i</font><br />",z_ziele[id])
		write_file(path_to_file,Data,-1);
	}
	if(o_korz[id])
	{
		format(Data,1024,"<font color=white>Ognisty Korzen: %i</font><br />",o_korz[id])
		write_file(path_to_file,Data,-1);
	}
	if(s_korz[id])
	{
		format(Data,1024,"<font color=white>Smoczy Korzen: %i</font><br />",s_korz[id])
		write_file(path_to_file,Data,-1);
	}
	if(s_kru[id])
	{
		format(Data,1024,"<font color=white>Szczaw Krolewski: %i</font><br />",s_kru[id])
		write_file(path_to_file,Data,-1);
	}
 
	format(Data,1024,"</b></center></body></html>")
	write_file(path_to_file,Data,-1);
	show_motd(id,path_to_file,"Item")
	return PLUGIN_HANDLED
}
public fwTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_alive(this) || !is_user_connected(this) || !is_user_connected(idattacker) || get_user_team(this) == get_user_team(idattacker)){
		return HAM_IGNORED;
	}
 
	new health = get_user_health(this);
 
	if(health < 2){
		return HAM_IGNORED;
	}
 
	damage=dmg_bron[idattacker]+8.0
 
	damage*=random_float(0.45,0.85)
 
	if(iLvl[idattacker]+5>iLvl[this]){
		damage*=random_float(0.60,0.80)
	}
 
	SetHamParamFloat(4, damage);
	return HAM_IGNORED;
}
public PlayerPreThink(id) 
{     
	if(!is_user_alive(id)) 
		return FMRES_IGNORED 
 
	if(get_user_weapon(id) != CSW_KNIFE) 
		return FMRES_IGNORED 
 
	if(tryb_broni[id]>1) set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK) 
	else set_pev(id, pev_button, pev(id,pev_button) & ~IN_ATTACK2) 
 
	return FMRES_HANDLED 
} 
//////////////////////////////////
public change_health(id,hp,attacker,weapon[])
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		new health = get_user_health(id)
		if(hp>0)
		{
			if (hp+health>zycie[id]) set_user_health(id,zycie[id])
			else set_user_health(id,get_user_health(id)+hp)
		}
		else
		{
			if(health+hp<1)
			{
				//UTIL_Kill(attacker,id,weapon)
			}
			else set_user_health(id,get_user_health(id)+hp)
		}
	}
}
public change_mana(id,ile)
{
	if(is_user_alive(id) && is_user_connected(id))
	{
		if(ile+aktualna_mana[id]>mana[id]) aktualna_mana[id] = mana[id]
		else aktualna_mana[id]+=ile
	}
}
public showmenu(id)
{
	new text[513] 
	new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<8)|(1<<9)
 
 
 
	format(text, 512, "\wMenu^n\r1. \wPlecak^n\r2. \wStatystyki^n\r3. \wMiecze^n\r4. \dZbroie^n\r5. \wUmiejetnosci^n^n\r0. Zamknij") 
 
	show_menu(id, keys, text, -1, "Opcje")
	return PLUGIN_HANDLED  
} 
public option_menu(id, key) 
{ 
	client_cmd(id, "spk diablosound/wybierz");
	switch(key) 
	{ 
		case 0: 
		{	
			info_eq(id)
		}
		case 1: 
		{	
			skilltree(id)
		}
		case 2: 
		{	
			wybierz_bron(id)
		}
		case 3: 
		{	
 
		}
		case 4:
		{
			glowne_umiejetnosci(id)
		}
		case 5:
		{
 
		}
		case 8:
		{
 
		}
		case 9:
		{
			return PLUGIN_HANDLED
		}
	}
 
	return PLUGIN_HANDLED
}
/* FUNCTIONS ====================================================================================== */
 
public aktywna_func(id, menu, item){
	return ITEM_ENABLED;
}
 
public nieaktywna_func(id, menu, item){
	return ITEM_DISABLED;
}
public wybierz_bron(id)
{
	new MyMenu=menu_create("Itemy","itemy_menu_handle");
 
	new aktywna=menu_makecallback("aktywna_func");
 
	new nieaktywna=menu_makecallback("nieaktywna_func");
 
	if(bron1[id] != 0){
		menu_additem(MyMenu,lista_broni[bron1[id]],"",0,aktywna);
	}
	else
	{
		menu_additem(MyMenu,"None","",0,nieaktywna);
	} 
	if(bron2[id] != 0){
		menu_additem(MyMenu,lista_broni[bron2[id]],"",0,aktywna);
	}
	else
	{
		menu_additem(MyMenu,"None","",0,nieaktywna);
	}
	if(bron3[id] != 0){
		menu_additem(MyMenu,lista_broni[bron3[id]],"",0,aktywna);
	}
	else
	{
		menu_additem(MyMenu,"None","",0,nieaktywna);
	}
	if(bron4[id] != 0){
		menu_additem(MyMenu,lista_broni[bron4[id]],"",0,aktywna);
	}
	else
	{
		menu_additem(MyMenu,"None","",0,nieaktywna);
	}
 
	if(menu_option[id] == 0){
		menu_additem(MyMenu,"Zaloz \dKlik by zmienic","",0,aktywna);
	}
	else if(menu_option[id] == 1){
		menu_additem(MyMenu,"Drop \dKlik by zmienic","",0,aktywna);
	}
	else if(menu_option[id] == 2){
		menu_additem(MyMenu,"Info \dKlik by zmienic","",0,aktywna);
	}
 
	menu_setprop(MyMenu,MPROP_EXITNAME,"Wyjscie");
 
	menu_setprop(MyMenu,MPROP_BACKNAME,"Wroc")
	menu_setprop(MyMenu,MPROP_NEXTNAME,"Nastepne")
 
	//zawsze pokaż opcję wyjścia
	menu_setprop(MyMenu,MPROP_EXIT,MEXIT_ALL);
 
	menu_setprop(MyMenu,MPROP_PERPAGE,7)
 
	//kolor cyfry przycisku zmień na żółty
	//menu_setprop(MyMenu,MPROP_NUMBER_COLOR,"r");
 
	menu_display(id, MyMenu,0);
	return PLUGIN_HANDLED;
}
public itemy_menu_handle(id, menu, item){
	if(item == MENU_EXIT){
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	switch(item){
		case 0:{
			if(menu_option[id] == 1){
				drop_bron(id,0)
			}
			else if(menu_option[id] == 0){
				zaloz_bron(id,bron1[id]);
			}
			else if(menu_option[id] == 2){
				cmd_bron(id,bron1[id])
			}
 
		}
		case 1:{
			if(menu_option[id] == 1){
				drop_bron(id,1)
			}
			else if(menu_option[id] == 0){
				zaloz_bron(id,bron2[id]);
			}
			else if(menu_option[id] == 2){
				cmd_bron(id,bron2[id])
			}
 
		}
		case 2:{
			if(menu_option[id] == 1){
				drop_bron(id,2)
			}
			else if(menu_option[id] == 0){
				zaloz_bron(id,bron3[id]);
			}
			else if(menu_option[id] == 2){
				cmd_bron(id,bron3[id])
			}
 
		}
		case 3:{
			if(menu_option[id] == 1){
				drop_bron(id,3)
			}
			else if(menu_option[id] == 0){
				zaloz_bron(id,bron4[id]);
			}
			else if(menu_option[id] == 2){
				cmd_bron(id,bron4[id])
			}
 
		}
		case 4:{
 
			if(menu_option[id] == 0){
				menu_option[id] = 1;
				wybierz_bron(id)
			}
			else if(menu_option[id] == 1){
				menu_option[id] = 2;
				wybierz_bron(id)
			}
			else if(menu_option[id] == 2){
				menu_option[id] = 0;
				wybierz_bron(id)
			}
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
////////////////////////////////////////////
public glowne_umiejetnosci(id)
{
	new MyMenu=menu_create("Umiejetnosci","umie_handle");
 
	new aktywna=menu_makecallback("aktywna_func");
 
 
	menu_additem(MyMenu,"Alchemia","",0,aktywna);
 
	menu_setprop(MyMenu,MPROP_EXITNAME,"Wyjscie");
 
	menu_setprop(MyMenu,MPROP_BACKNAME,"Wroc")
	menu_setprop(MyMenu,MPROP_NEXTNAME,"Nastepne")
 
	//zawsze pokaż opcję wyjścia
	menu_setprop(MyMenu,MPROP_EXIT,MEXIT_ALL);
 
	menu_setprop(MyMenu,MPROP_PERPAGE,7)
 
	//kolor cyfry przycisku zmień na żółty
	//menu_setprop(MyMenu,MPROP_NUMBER_COLOR,"r");
 
	menu_display(id, MyMenu,0);
	return PLUGIN_HANDLED;
}
public umie_handle(id, menu, item){
	if(item == MENU_EXIT){
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	switch(item){
		case 0:{
			alchemia_menu(id)
 
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
////////////////////////////////////////////
public alchemia_menu(id)
{
	new MyMenu=menu_create("Alchemia","al_menu_handle");
 
	new aktywna=menu_makecallback("aktywna_func");
 
	new nieaktywna=menu_makecallback("nieaktywna_func");
	if(alchemia[id]){
		if(menzurka[id]){
			if(r_lecz[id] && rdes[id]){
				menu_additem(MyMenu,"Mikstura zycia x1","",0,aktywna);
			}
			else menu_additem(MyMenu,"Potrzebne Roslina lecznicza i Rdes","",0,nieaktywna);
			if(o_korz[id] && rdes[id]){
				menu_additem(MyMenu,"Mikstura many x1","",0,aktywna);
			}
			else menu_additem(MyMenu,"Potrzebne Ognisty Korzen i Rdes","",0,nieaktywna);
		}
		else menu_additem(MyMenu,"Nie masz menzurki","",0,nieaktywna);
	}
	else menu_additem(MyMenu,"Umiejetnosc nie wyuczona","",0,nieaktywna);
 
	menu_setprop(MyMenu,MPROP_EXITNAME,"Wyjscie");
 
	menu_setprop(MyMenu,MPROP_BACKNAME,"Wroc")
	menu_setprop(MyMenu,MPROP_NEXTNAME,"Nastepne")
 
	//zawsze pokaż opcję wyjścia
	menu_setprop(MyMenu,MPROP_EXIT,MEXIT_ALL);
 
	menu_setprop(MyMenu,MPROP_PERPAGE,7)
 
	//kolor cyfry przycisku zmień na żółty
	//menu_setprop(MyMenu,MPROP_NUMBER_COLOR,"r");
 
	menu_display(id, MyMenu,0);
	return PLUGIN_HANDLED;
}
public al_menu_handle(id, menu, item){
	if(item == MENU_EXIT){
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	switch(item){
		case 0:{
			r_lecz[id]--
			rdes[id]--
			menzurka[id]--
 
			m_zycia[id]++
			ColorChat(id, YELLOW, "Zrobiono miksture")
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
 
public skilltree(id)
{
	new text[513],keys
 
	format(text, 512, "\wPunkty Nauki: %i^n^n\r1. \wSila \r%i^n\r2. \wZrecznosc \r%i^n\r3. \wMana \r%i^n^n\r0. \w Wyjdz",
	player_pkt[id],sila[id],zrecznosc[id],mana[id])
 
	keys = (1<<0)|(1<<1)|(1<<2)|(1<<9)
	show_menu(id, keys, text) 
	return PLUGIN_HANDLED  
} 
public skill_menu(id, key) 
{ 
	if(player_pkt[id] == 0){
		ColorChat(id, GREEN, "Nie masz punktow nauki")
		return PLUGIN_HANDLED
	}
 
	switch(key) 
	{ 
		case 0: 
		{	
			if(sila[id]<200)
			{
				player_pkt[id]-=1	
				sila[id]+=1
			}
		}
		case 1: 
		{	
			if(zrecznosc[id]<200)
			{
				player_pkt[id]-=1	
				zrecznosc[id]+=1
			}
		}
		case 2: 
		{	
			mana[id]+=5
			player_pkt[id]-=1
		}
		case 9: 
		{	
			return PLUGIN_HANDLED
		}
 
	}
 
	if (player_pkt[id] > 0 && key !=9) 
		skilltree(id)
 
 
	return PLUGIN_HANDLED
}
public BlokujKomende()
	return PLUGIN_HANDLED;
 
public drop_bron(id,mod)
{
	switch(mod) 
	{ 
		case 0:
		{
			if(moja_bron[id] == bron1[id]) moja_bron[id] = 0
			bron1[id] = bron2[id]
			bron2[id] = bron3[id]
			bron3[id] = bron4[id]
			bron4[id] = 0
		}
		case 1:
		{
			if(moja_bron[id] == bron2[id]) moja_bron[id] = 0
			bron2[id] = bron3[id]
			bron3[id] = bron4[id]
			bron4[id] = 0
		}
		case 2:
		{
			if(moja_bron[id] == bron3[id]) moja_bron[id] = 0
			bron3[id] = bron4[id]
			bron4[id] = 0
		}
		case 3:
		{
			if(moja_bron[id] == bron4[id]) moja_bron[id] = 0
			bron4[id] = 0
		}
	}
	aktywuj_bron(id)
}
public zaloz_bron(id,bron_id)
{
 
	if(sila[id]<sila_do_broni[bron_id]){
		ColorChat(id, GREEN, "Malo Sily")
		return PLUGIN_HANDLED
	}
 
	moja_bron[id] = bron_id	
	ColorChat(id, GREEN, "Zalozyles ^x04 %s^x01",lista_broni[moja_bron[id]])
	aktywuj_bron(id)
	return PLUGIN_HANDLED
}
public aktywuj_bron(id)
{
	tryb_broni[id] = tryb_broni[moja_bron[id]]
	dmg_bron[id] = dmg_broni[moja_bron[id]]
	aktualna_mana[id] = mana[id]
	if(sila[id] == 0){
		zycie[id] = 200
		mana[id] = 90
		sila[id] = 10
		zrecznosc[id] = 8
		award_bron(id,1)
		m_zycia[id] = 10
	}
}
public cmd_bron(id,bron_id)
{
	static motd[1050],header[100],len
	len = 0
	len += formatex(motd[len],sizeof motd - 1 - len,"<body bgcolor=#000000 text=#FFB000>")
	len += formatex(motd[len],sizeof motd - 1 - len,"<table bordercolor=3366FF width=700 border=1 cellpadding=4 cellspacing=8>")
	len += formatex(motd[len],sizeof motd - 1 - len,"<td><font color=green><br><center><b>%s <font color=white>-%s</center><br></font></td></table><br>",lista_broni[bron_id],tryb_bron[bron_id]>1?"Dwureczna":"Jednoreczna")
	len += formatex(motd[len],sizeof motd - 1 - len,"<table bordercolor=3366FF width=700 border=1 cellpadding=4 cellspacing=8>")
	len += formatex(motd[len],sizeof motd - 1 - len,"<td><font color=white><br><center><b>Wymagana Sila <font color=%s>%i</b></center><br></font></td></table>",sila[id]>sila_do_broni[bron_id]?"green":"red",sila_do_broni[bron_id])
	len += formatex(motd[len],sizeof motd - 1 - len,"<table bordercolor=3366FF width=700 border=1 cellpadding=4 cellspacing=8>")
	len += formatex(motd[len],sizeof motd - 1 - len,"<td><font color=white><br><center><b>Obrazenia + %i</b></center><br></font></td></table>",dmg_broni[bron_id])
	len += formatex(motd[len],sizeof motd - 1 - len,"<table bordercolor=3366FF width=700 border=1 cellpadding=4 cellspacing=8>")
	len += formatex(motd[len],sizeof motd - 1 - len,"<td><font color=white><br><center><b>Wartosc %i monet</b></center><br></font></td></table>",cena_broni[bron_id])
 
	formatex(header,sizeof header - 1,"Bron")
 
	show_motd(id,motd,header)     
}
public klawisz1(id)
{	
	if(ma_funkcje1[id]>0) dzialaj(id,ma_funkcje1[id])
	else przydziel(id)
 
	return PLUGIN_HANDLED
}
public klawisz2(id)
{	
	if(ma_funkcje1[id]>0) dzialaj(id,ma_funkcje2[id])
	else przydziel(id)
 
	return PLUGIN_HANDLED
}
public klawisz3(id)
{
	if(ma_funkcje1[id]>0) dzialaj(id,ma_funkcje3[id])
	else przydziel(id)
 
	return PLUGIN_HANDLED
}
public klawisz4(id)
{
	if(ma_funkcje1[id]>0) dzialaj(id,ma_funkcje4[id])
	else przydziel(id)
 
	return PLUGIN_HANDLED
}
public klawisz5(id)
{
	if(ma_funkcje1[id]>0) dzialaj(id,ma_funkcje5[id])
	else przydziel(id)
 
	return PLUGIN_HANDLED
}
public przydziel(id)
{
	if(menu_przydziel[id] == 0)menu_przydziel[id] = 1
 
	new MyMenu=menu_create("Przydziel","przydziel_menu_handle");
 
	new aktywna=menu_makecallback("aktywna_func");
 
	menu_additem(MyMenu,"Mikstury","",0,aktywna);
	menu_additem(MyMenu,"Zwoje","",0,aktywna);
	menu_additem(MyMenu,"Runy","",0,aktywna);
	menu_additem(MyMenu,"Magia","",0,aktywna);
	menu_additem(MyMenu,"Ksiegi","",0,aktywna);
 
	switch(menu_przydziel[id]){
		case 1:menu_additem(MyMenu,"Klawisz 1","",0,aktywna);
			case 2:menu_additem(MyMenu,"Klawisz 2","",0,aktywna);
			case 3:menu_additem(MyMenu,"Klawisz 3","",0,aktywna);
			case 4:menu_additem(MyMenu,"Klawisz 4","",0,aktywna);
			case 5:menu_additem(MyMenu,"Klawisz 5","",0,aktywna);
		}
 
	menu_setprop(MyMenu,MPROP_EXITNAME,"Wyjscie");
 
	menu_setprop(MyMenu,MPROP_BACKNAME,"Wroc")
	menu_setprop(MyMenu,MPROP_NEXTNAME,"Nastepne")
 
	//zawsze pokaż opcję wyjścia
	menu_setprop(MyMenu,MPROP_EXIT,MEXIT_ALL);
 
	menu_setprop(MyMenu,MPROP_PERPAGE,7)
 
	//kolor cyfry przycisku zmień na żółty
	//menu_setprop(MyMenu,MPROP_NUMBER_COLOR,"r");
 
	menu_display(id, MyMenu,0);
	return PLUGIN_HANDLED;
}
public przydziel_menu_handle(id, menu, item){
	if(item == MENU_EXIT){
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	switch(item){
		case 0:{
			przydziel_mikstury(id)
		}
		case 1:{
		}
		case 2:{
		}
		case 3:{
		}
		case 4:{
		}
		case 5:{
			przydziel(id)
			switch(menu_przydziel[id]){
				case 1:menu_przydziel[id] = 2
					case 2:menu_przydziel[id] = 3
					case 3:menu_przydziel[id] = 4
					case 4:menu_przydziel[id] = 5
					case 5:menu_przydziel[id] = 1
				}
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public przydziel_mikstury(id)
{
	new MyMenu=menu_create("Mikstury","przydziel_mikstury_handle");
 
	new aktywna=menu_makecallback("aktywna_func");
	new nieaktywna=menu_makecallback("nieaktywna_func");
 
	if(m_zycia[id]>0){
		menu_additem(MyMenu,"Zycia","",0,aktywna);
	}else menu_additem(MyMenu,"Zycia","",0,nieaktywna);
	if(m_mana[id]>0){
		menu_additem(MyMenu,"Many","",0,aktywna);
	}else menu_additem(MyMenu,"Many","",0,nieaktywna);
 
	menu_setprop(MyMenu,MPROP_EXITNAME,"Wyjscie");
 
	menu_setprop(MyMenu,MPROP_BACKNAME,"Wroc")
	menu_setprop(MyMenu,MPROP_NEXTNAME,"Nastepne")
 
	//zawsze pokaż opcję wyjścia
	menu_setprop(MyMenu,MPROP_EXIT,MEXIT_ALL);
 
	menu_setprop(MyMenu,MPROP_PERPAGE,7)
 
	//kolor cyfry przycisku zmień na żółty
	//menu_setprop(MyMenu,MPROP_NUMBER_COLOR,"r");
 
	menu_display(id, MyMenu,0);
	return PLUGIN_HANDLED;
}
public przydziel_mikstury_handle(id, menu, item){
	if(item == MENU_EXIT){
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	switch(item){
		case 0:{
			switch(menu_przydziel[id]){
				case 1:ma_funkcje1[id] = 1
					case 2:ma_funkcje2[id] = 1
					case 3:ma_funkcje3[id] = 1
					case 4:ma_funkcje4[id] = 1
					case 5:ma_funkcje5[id] = 1
				}
			ColorChat(id, YELLOW, "Mikstury zycia pod klawiszem %i",menu_przydziel[id])
		}
		case 1:{
			switch(menu_przydziel[id]){
				case 1:ma_funkcje1[id] = 2
					case 2:ma_funkcje2[id] = 2
					case 3:ma_funkcje3[id] = 2
					case 4:ma_funkcje4[id] = 2
					case 5:ma_funkcje5[id] = 2
				}
			ColorChat(id, YELLOW, "Mikstury many pod klawiszem %i",menu_przydziel[id])
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public dzialaj(id,mode)
{
	switch(mode){
		case 1:pij_zycie(id)
			case 2:pij_mana(id)
		}
}
public pij_zycie(id)
{
	if(get_user_health(id) == zycie[id]){
		ColorChat(id, YELLOW, "Full hp")
		return PLUGIN_HANDLED;
	}
 
	if(m_zycia[id]<1){
		ColorChat(id, YELLOW, "Brak Mikstur")
		return PLUGIN_HANDLED;
	}
 
 
	m_zycia[id]--
	change_health(id,60,0,"")
	ColorChat(id, YELLOW, "Pozostalo %i mikstur",m_zycia[id])
	aura(id,255,0,0)
 
	return PLUGIN_HANDLED;
}
public pij_mana(id)
{
	if(aktualna_mana[id] == mana[id]){
		ColorChat(id, YELLOW, "Full mana")
		return PLUGIN_HANDLED;
	}
	if(m_mana[id]<1)
		return PLUGIN_HANDLED;
 
 
	m_mana[id]--
	change_mana(id,40)
	ColorChat(id, YELLOW, "Pozostalo %i mikstur",m_zycia[id])
	aura(id,0,0,255)
 
	return PLUGIN_HANDLED;
}
stock aura(id,r,g,b)
{
	new origin[3];
	get_user_origin(id,origin);
 
	message_begin( MSG_BROADCAST, 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] + 60)
	write_coord( origin[2] + 60);
	write_short( sprite_white );
	write_byte( 0 ); // startframe
	write_byte( 0 ); // framerate
	write_byte( 10 ); // life
	write_byte( 10 ); // width
	write_byte( 255 ); // noise
	write_byte( r); // r, g, b
	write_byte( g); // r, g, b
	write_byte( b ); // r, g, b
	write_byte( 170 ); // brightness
	write_byte( 6 ); // speed
	message_end();
}
public respawn_player(id) 
{      
	id -=csdm_task;
	if (!is_user_connected(id) || is_user_alive(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR|| cs_get_user_team(id) == CS_TEAM_UNASSIGNED) return
 
	new maxpl,players[32]
	get_players(players, maxpl) 
 
	if (maxpl > 2)
	{
		ExecuteHamB(Ham_CS_RoundRespawn, id)
		fm_give_item(id, "weapon_knife");
		set_task(0.5,"add_respawn",id+1999)
	}
}
 
public add_respawn(id){
	id-=1999;
	change_health(id,2000,0,"")
}
public ustaw_hp(id){
	change_health(id,2000,0,"")
}