Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.77 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <amxmisc>
  4. #include <nvault>
  5. #include <fakemeta>
  6. #include <colorchat>
  7. #include <hamsandwich>
  8. #include <cstrike>
  9. #include <fun>
  10. #include <csx>
  11. #include <tutor>
  12. #include <expmod_mission>
  13.  
  14.  
  15. #define PLUGIN "ExpMod"
  16. #define VERSION "1.9.8 fixed"
  17. #define AUTHOR "tomcionek15 & grs4"
  18.  
  19.  
  20.  
  21. #define MAX_PUNKTOW 150 // Levele / 4, na jeden skill
  22. #define MAX_ULTRA_PUNKTOW 2 // (Levele/10)/4 Na jeden skill
  23. #define PUNKTY_ZA_LEVEL 3 // Punkty za poziom
  24.  
  25. //Ultra Punkty
  26.  
  27. #define MNOZNIK_NIEWIDZIALNOSCI 48 // * 5 - 255 Niewidzialny na maxa
  28. #define MNOZNIK_OBRAZEN 7 // * 5 - Dodatkowe Obrazenia
  29. #define MNOZNIK_SKOKOW 1 // * 5 - Dodatkowe Skoki w powietrzu za 1 u. pkt.
  30. #define MNOZNIK_LONGJUMPA 15 // * 5 +170
  31.  
  32. //PUNKTY
  33.  
  34. #define MNOZNIK_ZYCIA 1 // * 150 // Dodatkowe HP
  35. #define MNOZNIK_SZYBKOSCI 0.65 // * 150+250 - Maksymalna predkosc
  36. #define MNOZNIK_GRAWITACJI 1.5 // * 150 / 800
  37. #define MNOZNIK_KASY 35 // * 150 = 5250
  38.  
  39. #define ADMIN_MENU_FLAG ADMIN_LEVEL_D // Flaga Admin Menu = Admin Immunity
  40. #define VIP_FLAG ADMIN_LEVEL_H // Flaga "t" - Dla VIPA
  41.  
  42. #define SCOREATTRIB_DEAD (1 << 0)
  43. #define SCOREATTRIB_VIP (1 << 2)
  44.  
  45. #define SCIEZKA_PLIKU "addons/amxmodx/configs/expmod.cfg" //
  46.  
  47. #define TASK_HUD_INFO 8191
  48.  
  49. // POZIOMY //
  50.  
  51.  
  52. new const POZIOM[] =
  53. {
  54. 200,800,1800,3200,5000,7200,9800,12800,16200,20000,24200,28800,33800,39200, //0 - 14
  55. 45000,51200,57800,64800,72200,80000,88200,96800,105800,115200,125000,135200, //15 - 27
  56. 145800,156800,168200,180000,192200,204800,217800,231200,245000,259200,273800, //28 - 39
  57. 288800,304200,320000,336200,352800,369800,387200,405000,423200,441800,460800, //40 - 51
  58. 480200,500000,520200,540800,561800,583200,605000,627200,649800,672800,696200, //52 - 62
  59. 720000,744200,768800,793800,819200,845000,871200,897800,924800,952200,980000, //63 - 73
  60. 1008200,1036800,1065800,1095200,1125000,1155200,1185800,1216800,1248200,1280000, //74 - 84
  61. 1312200,1344800,1377800,1411200,1445000,1479200,1513800,1548800,1584200,1620000, //85 - 95
  62. 1656200,1692800,1729800,1767200,1805000,1843200,1881800,1920800,1960200,2000000, //96 - 106
  63. 2040200,2080800,2121800,2163200,2205000,2247200,2289800,2332800,2376200,2420000, //107 - 117
  64. 2464200,2508800,2553800,2599200,2645000,2691200,2737800,2784800,2832200,2880000, //118 - 128
  65. 2928200,2976800,3025800,3075200,3125000,3175200,3225800,3276800,3328200,3380000, //129 - 139
  66. 3432200,3484800,3537800,3591200,3645000,3699200,3753800,3808800,3864200,3920000, //140 - 150
  67. 3976200,4032800,4089800,4147200,4205000,4263200,4321800,4380800,4440200,4500000, //151 - 161
  68. 4560200,4620800,4681800,4743200,4805000,4867200,4929800,4992800,5056200,5120000, //162 - 172
  69. 5184200,5248800,5313800,5379200,5445000,5511200,5577800,5644800,5712200,5780000, //173 - 183
  70. 5848200,5916800,5985800,6055200,6125000,6195200,6265800,6336800,6408200,6480000, //184 - 194
  71. 6552200,6624800,6697800,6771200,6845000,6919200,6993800,7068800,7144200,7220000, //195 - 20... - Jest 200 lvl ... xd
  72. 7296200,7372800,7449800,7527200,7605000,7683200,7761800,7840800,7920200,8070200, 1073741824 //-107[...] ¿eby nie by³o bugów ;)
  73.  
  74. }
  75.  
  76.  
  77.  
  78.  
  79. new g_MsgScoreAttrib = 0;
  80.  
  81.  
  82.  
  83. new poziom_gracza[33]
  84. new doswiadczenie_gracza[33]
  85. new punkty_gracza[33]
  86. new ultra_punkty_gracza[33]
  87. new monety_gracza[33]
  88.  
  89.  
  90.  
  91. new zycie_gracza[33], nowe_zycie_gracza[33]
  92. new niewidzialnosc_gracza[33], nowa_niewidzialnosc_gracza[33]
  93. new obrazenia_gracza[33], nowe_obrazenia_gracza[33]
  94. new szybkosc_gracza[33], Float:nowa_szybkosc_gracza[33]
  95. new grawitacja_gracza[33], Float:nowa_grawitacja_gracza[33]
  96. new kasa_gracza[33], nowa_kasa_gracza[33]
  97. new skoki_gracza[33], nowe_skoki_gracza[33]
  98. new longjump_gracza[33], nowy_longujmp_gracza[33], longjump_czas[33], longjump_s_czas[33]
  99.  
  100.  
  101. new nazwa_gracza[33];
  102.  
  103. new plik;
  104.  
  105. //USER
  106.  
  107. new p_exp_zabojstwo[2] //Kill Exp
  108. new p_exp_headshot //KIll hs Exp
  109. new p_exp_podlozenie_paki //PP Exp
  110. new p_exp_rozbrojenie_paki //RP EXP
  111. new p_exp_uratowanie_hosta
  112. new p_exp_infostyle
  113. /*
  114. p_exp_infostyle = 0 // NIC
  115. p_exp_infostyle = 1 // TUTOR
  116. p_exp_infostyle = 2 // COLORCHAT
  117. p_exp_infostyle = 3 // TUTOR + COLORCHAT
  118. */
  119. new p_exp_tutor_sound
  120. new p_exp_wygrana_runda
  121. new p_exp_boty
  122. new p_exp_savetime
  123. new p_exp_hud_level
  124. new p_exp_knife_invisible
  125. new p_exp_of_players
  126.  
  127. /* p_exp_hud_level
  128. 0 - nothing
  129. 1 - alive
  130. 2 - death
  131. 3 - alive/death
  132. */
  133.  
  134.  
  135.  
  136.  
  137. new p_exp_vip_extra_hp
  138. new p_exp_vip_extra_speed
  139. new p_exp_vip_extra_gravity
  140. new p_exp_vip_extra_monets
  141. new p_exp_vip_extra_exp
  142. new p_exp_vip_extra_hs_exp
  143. new p_exp_vip_new_round_info
  144. new p_exp_vip_new_round_infostyle
  145.  
  146.  
  147. /*0 = nothing |
  148. 1 = tutor |
  149. 2 = ColorChat |
  150. 3 = Tutor + Colorchat*/
  151.  
  152. //ADMIN
  153.  
  154. new adminek[33]
  155. new id_am // id admin menu
  156.  
  157. new bool:first_round
  158. new bool:ft = true // Freeze Time
  159.  
  160. new folder_expmod[64] // addons/amxmodx/ExpMod
  161. new folder_amxx[64] // addons/amxmodx/
  162. new plik_expmod_staty[64] // addons/amxmodx/ExpMod/expmod_staty.txt
  163.  
  164.  
  165. //new Message1 //Sync Hud Obj 1
  166. new Message2 //Sync Hud Obj 2
  167. new Message3 //Sync Hud Obj 3
  168. new Message4 //Sync Hud Obj 4
  169. //new Message5 //Sync Hdu Obj 5
  170.  
  171. new menu_on[] = "ExpMod/menu_on.wav"
  172. new level_up[] = "ExpMod/levelup.wav"
  173. new level_up2[] = "ExpMod/levelup2.wav"
  174. new wyzwanie[] = "ExpMod/wyzwanie.wav"
  175. new komunikat1[] = "ExpMod/komunikat1.wav"
  176. new komunikat2[] = "ExpMod/komunikat2.wav"
  177. new odmowa[] = "ExpMod/odmowa.wav"
  178. new klik[] = "ExpMod/klik.wav"
  179. new klik2[] = "ExpMod/klik2.wav"
  180. new pstryk[] = "ExpMod/pstryk.wav"
  181. new warning[] = "ExpMod/warning.wav"
  182. new szum[] = "ExpMod/szum.wav"
  183. new pisk[] = "ExpMod/pisk.wav"
  184.  
  185. new prefix[] = "[JailBreaK PaiN]";
  186. new prefix_vip[] = "[JailBreaK PaiN]";
  187.  
  188. /*
  189. ^
  190. |
  191. Sciezki do dzwiekow
  192. */
  193.  
  194. //NATIVES
  195. public plugin_natives()
  196. {
  197. register_native("exp_get_user_level", "get_user_level", 1);
  198. register_native("exp_get_levelexp", "get_levelexp", 1);
  199. register_native("exp_get_user_exp", "get_user_exp", 1);
  200. register_native("exp_get_user_nextlevelexp", "get_user_nextlevelexp", 1);
  201. register_native("exp_get_user_previouslevelexp","get_user_previouslevelexp", 1);
  202. register_native("exp_set_user_exp", "set_user_exp", 1);
  203. register_native("exp_set_user_level", "set_user_level", 1);
  204. register_native("exp_save_exp", "ZapiszExp", 1);
  205. register_native("exp_set_user_invisible", "set_user_invisible", 1);
  206. register_native("exp_checklevel", "SprawdzExp", 1);
  207. register_native("exp_get_user_monets", "get_user_monets", 1);
  208. register_native("exp_set_user_monets", "set_user_monets", 1);
  209. register_native("exp_get_user_new_health", "get_user_new_health", 1);
  210. register_native("exp_reset", "Zresetuj", 1);
  211. register_native("exp_is_user_vip", "is_user_vip", 1);
  212.  
  213. }
  214.  
  215.  
  216.  
  217. public plugin_init()
  218. {
  219. register_plugin(PLUGIN, VERSION, AUTHOR)
  220. tutorInit()
  221.  
  222. register_dictionary("ExpMod.txt")
  223.  
  224.  
  225.  
  226.  
  227. register_event("DeathMsg", "DeathMsg", "a");
  228. register_event("CurWeapon", "CurWeapon", "be", "1=1");
  229. register_event("HLTV", "RundaHLTV", "a", "1=0", "2=0");
  230. register_event("SendAudio", "WygraTT", "a", "2&%!MRAD_terwin");
  231. register_event("SendAudio", "WygraCT", "a", "2&%!MRAD_ctwin");
  232.  
  233.  
  234.  
  235. register_logevent("RundaLogEvent",2, "1=Round_Start");
  236. register_logevent("KoniecRundyLogEvent", 2, "1=Round_End");
  237. register_logevent("UratowanieHosta",3, "2=Rescued_A_Hostage")
  238.  
  239. ///////////////////////////////////////////////////////
  240.  
  241. RegisterHam(Ham_Spawn, "player", "OdrodzenieGracza", 1);
  242. RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
  243.  
  244. g_MsgScoreAttrib = get_user_msgid("ScoreAttrib");
  245. register_message(g_MsgScoreAttrib, "messageScoreAttrib");
  246.  
  247.  
  248. register_forward(FM_CmdStart, "CmdStart");
  249.  
  250. p_exp_zabojstwo[0] = register_cvar("exp_kill_exp_tt", "250");
  251. p_exp_zabojstwo[1] = register_cvar("exp_kill_exp_ct", "150");
  252. p_exp_headshot = register_cvar("exp_killhs_exp", "100");
  253. p_exp_podlozenie_paki = register_cvar("exp_planted_bomb", "350");
  254. p_exp_rozbrojenie_paki = register_cvar("exp_defuse_bomb", "350");
  255. p_exp_uratowanie_hosta = register_cvar("exp_hostage_rescued", "250");
  256. p_exp_infostyle = register_cvar("exp_infostyle", "3");
  257. p_exp_wygrana_runda = register_cvar("exp_win_round", "200");
  258. p_exp_boty = register_cvar("exp_include_bots", "0");
  259. p_exp_tutor_sound = register_cvar("exp_tutor_sounds", "1");
  260. p_exp_hud_level = register_cvar("exp_hud_level", "3");
  261. p_exp_knife_invisible = register_cvar("exp_knife_invisible", "0");
  262. p_exp_of_players = register_cvar("exp_of_players", "2");
  263.  
  264.  
  265. p_exp_vip_extra_hp = register_cvar("exp_vip_extra_hp", "75");
  266. p_exp_vip_extra_speed = register_cvar("exp_vip_extra_speed", "50.0");
  267. p_exp_vip_extra_gravity = register_cvar("exp_vip_extra_gravity", "150");
  268. p_exp_vip_extra_monets = register_cvar("exp_vip_extra_monets", "1");
  269. p_exp_vip_extra_exp = register_cvar("exp_vip_extra_kill_exp", "100");
  270. p_exp_vip_extra_hs_exp = register_cvar("exp_vip_extra_killhs_exp", "60");
  271. p_exp_vip_new_round_info = register_cvar("exp_vip_info_new_round", "1");
  272. p_exp_vip_new_round_infostyle = register_cvar("exp_vip_info_new_round_style", "2");
  273.  
  274. //ADMIN
  275.  
  276. register_clcmd("ustaw_lvl","ustaw_lvl");
  277. register_clcmd("ustaw_exp","ustaw_exp");
  278. register_clcmd("dodaj_lvl","dodaj_lvl");
  279. register_clcmd("dodaj_exp","dodaj_exp");
  280. register_clcmd("dodaj_monety","dodaj_monety");
  281. register_clcmd("ustaw_monety","ustaw_monety");
  282.  
  283.  
  284. first_round = true
  285.  
  286.  
  287. register_clcmd("say /lvl", "Poziom");
  288. register_clcmd("say /level", "Poziom");
  289. register_clcmd("say /nivel", "Poziom");
  290.  
  291.  
  292. register_clcmd("say /exp", "Exp");
  293. register_clcmd("say /xp", "Exp");
  294. register_clcmd("say /experiencia", "Exp");
  295.  
  296. register_clcmd("say /asignar", "MenuPrzydzielPunkty");
  297. register_clcmd("say /asignarpuntos", "MenuPrzydzielPunkty");
  298. register_clcmd("say /asignarupuntos", "MenuPrzydzielUltraPunkty");
  299. register_clcmd("say /puntos", "Punkty");
  300. register_clcmd("say /upuntos", "UPunkty");
  301. register_clcmd("say /menu", "MenuWybor");
  302. register_clcmd("menu", "MenuWybor");
  303.  
  304. register_clcmd("say /reset", "MenuResetWybor");
  305. register_clcmd("say /resetu", "MenuResetWybor");
  306. register_clcmd("say /stats", "MotdStatystyki");
  307. register_clcmd("say /esstadisticas", "MotdStatystyki");
  308.  
  309. register_clcmd("say /cargarcfg", "WczytajUstawienia", ADMIN_RCON);
  310.  
  311.  
  312. p_exp_savetime = register_cvar("exp_savetime", "120.0")
  313.  
  314. if(get_pcvar_float(p_exp_savetime) != 0.0)
  315. set_task(get_pcvar_float(p_exp_savetime), "ZaapiszExp", _, _, _, "b")
  316.  
  317.  
  318. //Message1= CreateHudSyncObj();
  319. Message2 = CreateHudSyncObj();
  320. Message3 = CreateHudSyncObj();
  321. Message4 = CreateHudSyncObj();
  322.  
  323. get_basedir(folder_amxx, 63)
  324.  
  325. formatex(folder_expmod, 63, "%s/ExpMod", folder_amxx);
  326. formatex(plik_expmod_staty, 63, "%s/motd_statytsyki", folder_expmod);
  327.  
  328. if(!file_exists(folder_expmod))
  329. mkdir(folder_expmod)
  330.  
  331. WczytajUstawienia()
  332. }
  333.  
  334. //
  335.  
  336. public Poziom(id)
  337. {
  338. if(!is_user_connected(id))
  339. return PLUGIN_CONTINUE;
  340.  
  341. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  342. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "CMD_PLAYER_LEVEL", poziom_gracza[id]);
  343.  
  344. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  345. {
  346. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  347. {
  348. switch(random_num(1,2))
  349. {
  350. case 1: client_cmd(id, "spk %s", komunikat1)
  351. case 2: client_cmd(id, "spk %s", komunikat2)
  352. }
  353. }
  354. tutorMake(id, TUTOR_GREEN, 5.0, "%L", id, "CMD_PLAYER_LEVEL", poziom_gracza[id]);
  355. }
  356. return PLUGIN_CONTINUE;
  357. }
  358.  
  359. public Exp(id)
  360. {
  361. if(!is_user_connected(id))
  362. return PLUGIN_CONTINUE;
  363.  
  364. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  365. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "CMD_PLAYER_EXP", doswiadczenie_gracza[id], POZIOM[poziom_gracza[id]+1], (POZIOM[poziom_gracza[id]+1]-doswiadczenie_gracza[id]));
  366.  
  367. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  368. {
  369. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  370. {
  371. switch(random_num(1,2))
  372. {
  373. case 1: client_cmd(id, "spk %s", komunikat1)
  374. case 2: client_cmd(id, "spk %s", komunikat2)
  375. }
  376. }
  377. tutorMake(id, TUTOR_GREEN, 5.0, "%L", id, "CMD_PLAYER_EXP", doswiadczenie_gracza[id], POZIOM[poziom_gracza[id]+1], (POZIOM[poziom_gracza[id]+1]-doswiadczenie_gracza[id]));
  378. }
  379. return PLUGIN_CONTINUE;
  380. }
  381.  
  382. public WczytajUstawienia()
  383. {
  384. new tekst[64], len
  385. new cvar[64], wartosc[16], komenda[128]
  386. if(!file_exists(SCIEZKA_PLIKU))
  387. return PLUGIN_CONTINUE
  388. for(new i = 0 ; read_file(SCIEZKA_PLIKU, i, tekst, 63, len); i ++)
  389. {
  390. if(tekst[0] == ';' || (tekst[0] == '/' && tekst[1] == '/'))
  391. continue;
  392.  
  393. parse(tekst, cvar, 63, wartosc, 15)
  394. if(equali(cvar, "exp_playerinfo_show_time"))
  395. formatex(komenda, 127, "%s %0.1f%", cvar, str_to_float(wartosc))
  396. else
  397. formatex(komenda, 127, "%s %d", cvar, str_to_num(wartosc))
  398.  
  399. server_cmd(komenda)
  400. }
  401. return PLUGIN_CONTINUE
  402. }
  403.  
  404. //
  405.  
  406. public plugin_precache()
  407. {
  408. tutorPrecache()
  409.  
  410. precache_sound(menu_on)
  411. precache_sound(wyzwanie)
  412. precache_sound(level_up)
  413. precache_sound(level_up2)
  414. precache_sound(komunikat1)
  415. precache_sound(komunikat2)
  416. precache_sound(odmowa)
  417. precache_sound(klik)
  418. precache_sound(klik2)
  419. precache_sound(pstryk)
  420. precache_sound(warning)
  421. precache_sound(szum)
  422. precache_sound(pisk)
  423. }
  424.  
  425. ///////////////////////////////////////////////////////
  426.  
  427. //
  428.  
  429. public WygraTT()
  430. {
  431. if(get_playersnum() < get_pcvar_num(p_exp_of_players) || first_round == true || get_pcvar_num(p_exp_wygrana_runda) <= 0)
  432. return PLUGIN_CONTINUE;
  433.  
  434. for(new i = 1;i < 33; i++)
  435. {
  436. if(!is_user_connected(i))
  437. continue;
  438. if(get_user_team(i) == 1 && first_round == false)
  439. {
  440.  
  441. doswiadczenie_gracza[i] += get_pcvar_num(p_exp_wygrana_runda);
  442.  
  443. SprawdzExp(i);
  444. ColorChat(i, GREEN, "%s^x01 %L",prefix, i, "MSG_TT_WIN_ROUND", get_pcvar_num(p_exp_wygrana_runda));
  445. }
  446. }
  447. return PLUGIN_CONTINUE;
  448. }
  449.  
  450. public WygraCT()
  451. {
  452. if(get_playersnum() < get_pcvar_num(p_exp_of_players) || first_round == true || get_pcvar_num(p_exp_wygrana_runda) <= 0)
  453. return PLUGIN_CONTINUE;
  454.  
  455. for(new i = 1; i < 33; i++)
  456. {
  457. if(!is_user_connected(i))
  458. continue;
  459.  
  460. if(get_user_team(i) == 2 && first_round == false)
  461. {
  462. doswiadczenie_gracza[i]+=get_pcvar_num(p_exp_wygrana_runda);
  463. SprawdzExp(i);
  464. ColorChat(i, GREEN, "%s^x01 %L", prefix, i, "MSG_CT_WIN_ROUND", get_pcvar_num(p_exp_wygrana_runda));
  465. }
  466. }
  467. return PLUGIN_CONTINUE
  468. }
  469.  
  470. //
  471.  
  472. public Punkty(id)
  473. {
  474. if(!is_user_connected(id))
  475. return PLUGIN_CONTINUE;
  476. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  477. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "CMD_PLAYER_POINTS", punkty_gracza[id]);
  478.  
  479. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  480. {
  481. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  482. {
  483. switch(random_num(1,2))
  484. {
  485. case 1: client_cmd(id, "spk %s", komunikat1)
  486. case 2: client_cmd(id, "spk %s", komunikat2)
  487. }
  488. }
  489. tutorMake(id, TUTOR_GREEN, 5.0, "%L", id, "CMD_PLAYER_POINTS", punkty_gracza[id]);
  490. }
  491. return PLUGIN_CONTINUE;
  492. }
  493.  
  494. public UPunkty(id)
  495. {
  496. if(!is_user_connected(id))
  497. return PLUGIN_CONTINUE;
  498. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  499. ColorChat(id, GREEN, "%s^x01 %L", prefix, "CMD_PLAYER_ULTRA_POINTS", ultra_punkty_gracza[id]);
  500.  
  501. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  502. {
  503. tutorMake(id, TUTOR_GREEN, 5.0, "%L", "CMD_PLAYER_ULTRA_POINTS", ultra_punkty_gracza[id]);
  504. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  505. {
  506. switch(random_num(1,2))
  507. {
  508. case 1: client_cmd(id, "spk %s", komunikat1)
  509. case 2: client_cmd(id, "spk %s", komunikat2)
  510. }
  511. }
  512. }
  513. return PLUGIN_CONTINUE;
  514. }
  515.  
  516.  
  517. public RundaLogEvent()
  518. {
  519. ft = false
  520.  
  521. }
  522.  
  523. ///////////////////////////////////////////////////////
  524.  
  525. public KoniecRundyLogEvent()
  526. {
  527. if(first_round == true)
  528. first_round = false
  529.  
  530. if(get_playersnum() < get_pcvar_num(p_exp_of_players))
  531. return PLUGIN_CONTINUE
  532.  
  533. for(new i = 1 ; i < 33 ; i++)
  534. {
  535.  
  536. if(!is_user_connected(i))
  537. return PLUGIN_CONTINUE
  538. if(get_user_team(i))
  539. {
  540. doswiadczenie_gracza[i]+= get_pcvar_num(p_exp_wygrana_runda)
  541. SprawdzExp(i)
  542. }
  543.  
  544. }
  545. return PLUGIN_CONTINUE
  546. }
  547.  
  548. ///////////////////////////////////////////////////////
  549.  
  550. public RundaHLTV()
  551. {
  552. ft = true
  553. }
  554.  
  555. ///////////////////////////////////////////////////////
  556.  
  557. public CurWeapon(id)
  558. {
  559. if(ft || !is_user_connected(id) || !is_user_alive(id))
  560. return PLUGIN_CONTINUE;
  561. new bron = read_data(2);
  562.  
  563. if(get_pcvar_num(p_exp_knife_invisible) == 1 && bron == CSW_KNIFE)
  564. set_user_invisible(id, (255-nowa_niewidzialnosc_gracza[id]))
  565.  
  566. if(get_user_flags(id) & VIP_FLAG)
  567. set_user_maxspeed(id, nowa_szybkosc_gracza[id]+250.0+get_pcvar_float(p_exp_vip_extra_speed))
  568. else
  569. set_user_maxspeed(id, nowa_szybkosc_gracza[id]+250.0)
  570.  
  571.  
  572. return PLUGIN_CONTINUE;
  573. }
  574.  
  575. ///////////////////////////////////////////////////////
  576. /*
  577. public Damage(id)
  578. {
  579. new idattacker = get_user_attacker(id);
  580. new damage = read_data(2);
  581. if(!is_user_alive(idattacker) || !is_user_connected(idattacker))
  582. return PLUGIN_CONTINUE;
  583.  
  584. SprawdzExp(idattacker)
  585.  
  586. return PLUGIN_CONTINUE
  587. }*/
  588. ///////////////////////////////////////////////////////
  589.  
  590. public MenuResetWybor(id)
  591. {
  592. if(poziom_gracza[id] == 0)
  593. {
  594. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  595. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESET_ERROR")
  596.  
  597. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  598. {
  599. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  600. {
  601. switch(random_num(1,2))
  602. {
  603. case 1: client_cmd(id, "spk %s", komunikat1)
  604. case 2: client_cmd(id, "spk %s", komunikat2)
  605.  
  606. }
  607. }
  608. tutorMake(id, TUTOR_YELLOW, 5.0, "%L", id, "MSG_RESET_ERROR")
  609. }
  610.  
  611. return PLUGIN_CONTINUE
  612. }
  613. client_cmd(id, "spk %s", menu_on)
  614. new tytul[128], punkty[64], upunkty[64]
  615.  
  616. formatex(tytul, 127, "%L", id, "MENU_RESET_QUESTION")
  617. formatex(punkty, 63, "%L", id, "POINTS")
  618. formatex(upunkty, 63, "%L", id, "ULTRA_POINTS")
  619.  
  620. new menu_reset_wybor = menu_create(tytul, "MenuResetWybor_Wybieranie")
  621. new menu_reset_wybor_cb = menu_makecallback("MenuResetWybor_Cb")
  622.  
  623. menu_additem(menu_reset_wybor, punkty, _, _, menu_reset_wybor_cb)
  624. menu_additem(menu_reset_wybor, upunkty, _, _, menu_reset_wybor_cb)
  625.  
  626. menu_setprop(menu_reset_wybor, MPROP_NUMBER_COLOR, "\r")
  627. menu_display(id, menu_reset_wybor)
  628.  
  629. return PLUGIN_CONTINUE
  630. }
  631.  
  632. public MenuResetWybor_Cb(id, menu_reset_wybor, item_reset_wybor)
  633. {
  634. if((item_reset_wybor == 0 && poziom_gracza[id] == 0) || (item_reset_wybor == 1 && poziom_gracza[id] < 10))
  635. return ITEM_DISABLED
  636. return ITEM_ENABLED
  637. }
  638.  
  639. public MenuResetWybor_Wybieranie(id, menu_reset_wybor, item_reset_wybor)
  640. {
  641. if(item_reset_wybor == MENU_EXIT)
  642. {
  643. menu_destroy(menu_reset_wybor)
  644. return PLUGIN_CONTINUE
  645. }
  646.  
  647. switch(item_reset_wybor)
  648. {
  649. case 0: MenuResetPunkty(id)
  650. case 1: MenuResetUltraPunkty(id)
  651. }
  652.  
  653. switch(random_num(1,2))
  654. {
  655. case 1:client_cmd(id, "spk %s", klik)
  656. case 2:client_cmd(id, "spk %s", klik2)
  657. }
  658.  
  659. return PLUGIN_CONTINUE
  660. }
  661.  
  662. public MenuResetUltraPunkty(id)
  663. {
  664. client_cmd(id, "spk %s", menu_on)
  665. new upr[200], tak[128]
  666.  
  667. formatex(upr, 199, "%L", id, "MENU_RESET_UPOINTS_QUESTION")
  668. formatex(tak, 127, "%L", id, "MENU_RESET_UPOINTS_ITEM")
  669.  
  670. new menu_reset_ultrapunkty = menu_create(upr, "MenuResetUltraPunkty_Wybieranie")
  671. menu_additem(menu_reset_ultrapunkty, tak)
  672.  
  673. menu_setprop(menu_reset_ultrapunkty, MPROP_NUMBER_COLOR, "\r")
  674.  
  675. menu_display(id, menu_reset_ultrapunkty)
  676. }
  677.  
  678. public MenuResetUltraPunkty_Wybieranie(id, menu_reset_ultrapunkty, item_reset_ultrapunkty)
  679. {
  680. if(item_reset_ultrapunkty == MENU_EXIT)
  681. {
  682. menu_destroy(menu_reset_ultrapunkty)
  683. return PLUGIN_CONTINUE
  684. }
  685. if(item_reset_ultrapunkty == 0)
  686. {
  687. Zresetuj(id, 0, 1, 0)
  688. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  689. {
  690. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESET_UPOINTS1")
  691. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESET_UPOINTS2", ultra_punkty_gracza[id])
  692. }
  693. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  694. {
  695. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  696. {
  697. switch(random_num(1,2))
  698. {
  699. case 1: client_cmd(id, "spk %s", komunikat1)
  700. case 2: client_cmd(id, "spk %s", komunikat2)
  701.  
  702. }
  703. }
  704.  
  705. tutorMake(id, TUTOR_GREEN, 10.0, "%L^n%L", id, "MSG_RESET_UPOINTS1", id, "MSG_RESET_UPOINTS2", ultra_punkty_gracza[id])
  706. }
  707. set_user_exp(id, get_user_exp(id)-2000)
  708.  
  709. MenuWybor(id)
  710. }
  711. switch(random_num(1,2))
  712. {
  713. case 1:client_cmd(id, "spk %s", klik)
  714. case 2:client_cmd(id, "spk %s", klik2)
  715. }
  716.  
  717. return PLUGIN_CONTINUE
  718. }
  719.  
  720. public MenuResetPunkty(id)
  721. {
  722. client_cmd(id, "spk %s", menu_on)
  723. Zresetuj(id, 1, 0, 0)
  724. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  725. {
  726. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESET_POINTS1")
  727. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESET_POINTS2", punkty_gracza[id])
  728. }
  729.  
  730. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  731. {
  732. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  733. {
  734. switch(random_num(1,2))
  735. {
  736. case 1: client_cmd(id, "spk %s", komunikat1)
  737. case 2: client_cmd(id, "spk %s", komunikat2)
  738.  
  739. }
  740. }
  741. tutorMake(id, TUTOR_GREEN, 10.0, "%L^n%L", id, "MSG_RESET_POINTS1", id, "MSG_RESET_POINTS2", punkty_gracza[id])
  742. }
  743.  
  744. MenuWybor(id)
  745. }
  746.  
  747. ///////////////////////////////////////////////////////
  748.  
  749. public client_putinserver(id)
  750. {
  751. WczytajExp(id)
  752.  
  753. if(get_user_flags(id) & VIP_FLAG)
  754. {
  755. get_user_name(id, nazwa_gracza, 32)
  756. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  757. ColorChat(0, GREEN, "%s^x01 %L",prefix_vip, LANG_SERVER, "MSG_VIP_CONNECT", nazwa_gracza)
  758.  
  759. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  760. {
  761. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  762. {
  763. switch(random_num(1,2))
  764. {
  765. case 1: client_cmd(id, "spk %s", komunikat1)
  766. case 2: client_cmd(id, "spk %s", komunikat2)
  767.  
  768. }
  769. }
  770.  
  771. tutorMake(0, TUTOR_YELLOW, 7.0, "%L^n%L!", LANG_SERVER, "MSG_VIP_CONNECT", nazwa_gracza, LANG_SERVER, "MSG_WELCOME")
  772. }
  773. }
  774.  
  775. remove_task(id+TASK_HUD_INFO)
  776.  
  777. set_task(2.5, "Pokaz", id+TASK_HUD_INFO)
  778. }
  779.  
  780. ///////////////////////////////////////////////////////
  781.  
  782. public client_disconnect(id)
  783. {
  784.  
  785. ZapiszExp(id)
  786. remove_task(id+TASK_HUD_INFO)
  787.  
  788. if(get_user_flags(id) & VIP_FLAG)
  789. {
  790. get_user_name(id, nazwa_gracza, 32)
  791. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  792. ColorChat(0, GREEN, "%s^x01 %L", prefix_vip, LANG_SERVER, "MSG_VIP_DISCONNECT", nazwa_gracza)
  793.  
  794. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  795. {
  796. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  797. {
  798. switch(random_num(1,2))
  799. {
  800. case 1: client_cmd(id, "spk %s", komunikat1)
  801. case 2: client_cmd(id, "spk %s", komunikat2)
  802.  
  803. }
  804. }
  805. tutorMake(0, TUTOR_YELLOW, 7.0, "%L^n%L", LANG_SERVER, "MSG_VIP_DISCONNECT", nazwa_gracza, LANG_SERVER, "MSG_BYE")
  806. }
  807.  
  808. }
  809. }
  810.  
  811.  
  812. ///////////////////////////////////////////////////////
  813.  
  814. public OdrodzenieGracza(id)
  815. {
  816. if(is_user_alive(id) && is_user_connected(id))
  817. {
  818. if(punkty_gracza[id] > 0 || ultra_punkty_gracza[id] > 0)
  819. MenuWybor(id)
  820. if(get_pcvar_num(p_exp_vip_new_round_info) == 1)
  821. {
  822. if(get_user_flags(id) & VIP_FLAG)
  823. {
  824. if(get_pcvar_num(p_exp_vip_new_round_infostyle) == 3 || get_pcvar_num(p_exp_vip_new_round_infostyle) == 1)
  825. {
  826. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  827. {
  828. switch(random_num(1,2))
  829. {
  830. case 1:client_cmd(id, "spk %s", komunikat2)
  831. case 2:client_cmd(id, "spk %s", komunikat1)
  832. }
  833. }
  834. tutorMake(id, TUTOR_YELLOW, 5.0, "%L^n%L : +%d HP | -%d GRAV^n+%0.1f% SPEED", id, "MSG_YOU_ARE_VIP", id, "MSG_YOU_GOT", get_pcvar_num(p_exp_vip_extra_hp),get_pcvar_num(p_exp_vip_extra_gravity),get_pcvar_float(p_exp_vip_extra_speed))
  835. }
  836. if(get_pcvar_num(p_exp_vip_new_round_infostyle) == 2 || get_pcvar_num(p_exp_vip_new_round_infostyle) == 3)
  837. {
  838. ColorChat(id, GREEN, "%s^x01 %L", prefix_vip, id, "MSG_YOU_ARE_VIP")
  839. ColorChat(id, GREEN, "%s^x01 %L : ^x04+%d ^x01HP | ^x04-%d ^x01GRAV | ^x04+%0.1f ^x01SPEED", prefix_vip, id, "MSG_YOU_GOT", get_pcvar_num(p_exp_vip_extra_hp),get_pcvar_num(p_exp_vip_extra_gravity),get_pcvar_float(p_exp_vip_extra_speed))
  840. }
  841. }
  842. }
  843.  
  844. if(get_pcvar_num(p_exp_knife_invisible) == 0)
  845. set_user_invisible(id, (255-nowa_niewidzialnosc_gracza[id]))
  846.  
  847. if((cs_get_user_money(id)+nowa_kasa_gracza[id]) > 16000)
  848. cs_set_user_money(id, 16000)
  849. else
  850. cs_set_user_money(id, cs_get_user_money(id)+nowa_kasa_gracza[id])
  851.  
  852. if(get_user_flags(id) & VIP_FLAG)
  853. {
  854. set_user_health(id, get_user_health(id)+nowe_zycie_gracza[id]+get_pcvar_num(p_exp_vip_extra_hp))
  855. set_user_gravity(id, ((800-nowa_grawitacja_gracza[id])-get_pcvar_num(p_exp_vip_extra_gravity))/800)
  856. }
  857. else
  858. {
  859. set_user_gravity(id, (800-nowa_grawitacja_gracza[id])/800)
  860. set_user_health(id, get_user_health(id)+nowe_zycie_gracza[id])
  861. }
  862.  
  863. if((get_user_health(id)%256) == 0)
  864. set_user_health(id, get_user_health(id)+1);
  865.  
  866.  
  867. }
  868. else
  869. return PLUGIN_CONTINUE
  870. return PLUGIN_CONTINUE
  871. }
  872.  
  873. ///////////////////////////////////////////////////////
  874.  
  875. public MenuWybor(id)
  876. {
  877. client_cmd(id, "spk %s", menu_on)
  878.  
  879. new wybor[255], punkty[64], upunkty[64], staty[64],
  880. reset[64], sklep[64], misje[64], imisje[64], amisje[64],
  881. ach[64], admin[64];
  882.  
  883. formatex(wybor, 255, "%L", id, "MENU_MAIN_TITLE", punkty_gracza[id], ultra_punkty_gracza[id], monety_gracza[id])
  884. formatex(punkty, 63, "%L", id, "MENU_MAIN_ADD_POINTS")
  885. formatex(upunkty, 63, "%L", id, "MENU_MAIN_ADD_ULTRA_POINTS")
  886. formatex(staty, 63, "%L", id, "MENU_MAIN_STATS")
  887. formatex(reset, 63, "%L", id, "MENU_MAIN_RESET")
  888. formatex(sklep, 63, "%L", id, "MENU_MAIN_SHOP")
  889. formatex(misje, 63, "%L", id, "MENU_MAIN_MISSION")
  890. formatex(imisje, 63, "%L", id, "MENU_MAIN_INFO_MISSION")
  891. formatex(amisje, 63, "%L", id, "MENU_MAIN_CANCEL_MISSION")
  892. formatex(ach, 63, "%L", id, "MENU_MAIN_ADD_ACHIEVEMENTS")
  893. formatex(admin, 63, "%L", id, "MENU_MAIN_ADMIN_MENU")
  894.  
  895. new menu_wybor = menu_create(wybor, "MenuWybor_Wybieranie")
  896. new menu_wybor_cb = menu_makecallback("MenuWybor_CallBack")
  897.  
  898. menu_additem(menu_wybor, punkty, _, _, menu_wybor_cb)
  899. menu_additem(menu_wybor, upunkty, _, _, menu_wybor_cb)
  900. menu_additem(menu_wybor, staty)
  901. menu_additem(menu_wybor, reset,_, _, menu_wybor_cb)
  902. menu_additem(menu_wybor, sklep)
  903. menu_additem(menu_wybor, misje)
  904. menu_additem(menu_wybor, imisje)
  905. menu_additem(menu_wybor, amisje)
  906. menu_additem(menu_wybor, ach)
  907. menu_additem(menu_wybor, admin, _, ADMIN_MENU_FLAG)
  908.  
  909.  
  910. menu_setprop(menu_wybor, MPROP_NUMBER_COLOR, "\r");
  911. menu_display(id, menu_wybor)
  912. if(get_pcvar_num(p_exp_boty) == 1)
  913. {
  914. if(is_user_bot(id))
  915. {
  916. if(punkty_gracza[id] > 0)
  917. MenuPrzydzielPunkty(id)
  918. else if(punkty_gracza[id] <= 0 && ultra_punkty_gracza[id] > 0)
  919. MenuPrzydzielUltraPunkty(id)
  920. }
  921. }
  922. }
  923.  
  924. public MenuWybor_CallBack(id, menu_wybor, item_wybor)
  925. {
  926. if((item_wybor == 0 && punkty_gracza[id] <= 0) || (item_wybor == 1 && ultra_punkty_gracza[id] <= 0))
  927. return ITEM_DISABLED
  928.  
  929. if(item_wybor == 3 && poziom_gracza[id] == 0)
  930. return ITEM_DISABLED
  931.  
  932. if(item_wybor == 7 && exp_get_user_mission(id) == 0)
  933. return ITEM_DISABLED
  934.  
  935. if(item_wybor == 9 && !(get_user_flags(id) & ADMIN_MENU_FLAG))
  936. return ITEM_DISABLED
  937.  
  938. return ITEM_ENABLED
  939. }
  940.  
  941. public MenuWybor_Wybieranie(id, menu_wybor, item_wybor)
  942. {
  943. if(item_wybor == MENU_EXIT)
  944. {
  945. menu_destroy(menu_wybor)
  946. return PLUGIN_CONTINUE
  947. }
  948.  
  949. switch(item_wybor)
  950. {
  951. case 0: MenuPrzydzielPunkty(id)
  952.  
  953. case 1: MenuPrzydzielUltraPunkty(id)
  954.  
  955. case 2: MotdStatystyki(id)
  956.  
  957. case 3: MenuResetWybor(id)
  958.  
  959. case 4: client_cmd(id, "say /tienda")
  960.  
  961. case 5: client_cmd(id, "say /mision")
  962.  
  963. case 6: client_cmd(id, "say /descripciones")
  964.  
  965. case 7: client_cmd(id, "say /anular")
  966.  
  967. case 8: client_cmd(id, "say /log")
  968.  
  969. case 9: MenuAdmin(id)
  970.  
  971. }
  972.  
  973. switch(random_num(1,2))
  974. {
  975. case 1:client_cmd(id, "spk %s", klik)
  976. case 2:client_cmd(id, "spk %s", klik2)
  977. }
  978. return PLUGIN_CONTINUE
  979. }
  980.  
  981. public MotdStatystyki(id)
  982. {
  983. new txt[2500], Len = 0
  984.  
  985. new punkty = (zycie_gracza[id]+szybkosc_gracza[id]+grawitacja_gracza[id]+kasa_gracza[id]+punkty_gracza[id])
  986. new ultrapunkty = (niewidzialnosc_gracza[id]+obrazenia_gracza[id]+skoki_gracza[id]+longjump_gracza[id]+ultra_punkty_gracza[id])
  987. new ileMa = floatround(nowa_szybkosc_gracza[id]), ilePotrzeba = 105, ilePotrzebaBylo = 0;
  988. new Float:nszybkosc = 0.0;
  989.  
  990. new ile_ma = floatround(nowa_grawitacja_gracza[id]),ile_potrzeba = 800, ile_potrzeba_bylo = 0;
  991. new Float:ngrawitacja = 0.0;
  992.  
  993. new ileMa1 = nowa_niewidzialnosc_gracza[id], ilePotrzeba1 = 255, ilePotrzebaBylo1 = 0;
  994. new Float:nniewidzialnosc = 0.0;
  995.  
  996. nniewidzialnosc = (float((ileMa1 - ilePotrzebaBylo1)) / float((ilePotrzeba1 - ilePotrzebaBylo1))) * 100.0;
  997. nszybkosc = (float((ileMa - ilePotrzebaBylo)) / float((ilePotrzeba - ilePotrzebaBylo))) * 100.0;
  998. ngrawitacja = (float((ile_ma - ile_potrzeba_bylo)) / float((ile_potrzeba - ile_potrzeba_bylo))) * 100.0;
  999.  
  1000. Len += format(txt, (sizeof txt - 1) - Len, "<body bgcolor=^"#000000^"><p align=^"center^"><font size=^"5^"><b>%L :</b></font></p align><font color=^"purple^"><font size=^"5^"><b>%L<p>", id, "STATS_STATS", id, "STATS_EXP", get_user_exp(id), get_user_nextlevelexp(id))
  1001. Len += format(txt[Len], (sizeof txt - 1) - Len, "<font color=^"brown^">%L<p><font color=^"yellow^">%L<p><font color=^"blue^">%L", id, "STATS_MISSING_EXP", (get_user_nextlevelexp(id)-get_user_exp(id)), id, "STATS_LEVEL_MONETS", poziom_gracza[id], monety_gracza[id], id, "STATS_POINTS_UPOINTS", punkty, ultrapunkty)
  1002. Len += format(txt[Len], (sizeof txt - 1) - Len, "<font color=^"pink^"><p align=^"center^"><font size=^"5^"><b>%L </b></font></p align><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L ", id, "POINTS", id, "STATS_HEALTH", id, "STATS_HEALTH_1", zycie_gracza[id], nowe_zycie_gracza[id])
  1003. Len += format(txt[Len], (sizeof txt - 1) - Len, "<p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L <p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L ", id, "STATS_SPEED", id, "STATS_SPEED_1", szybkosc_gracza[id], nszybkosc, id, "STATS_GRAVITY", id, "STATS_GRAVITY_1", grawitacja_gracza[id], ngrawitacja)
  1004. Len += format(txt[Len], (sizeof txt - 1) - Len, "<p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L <font color=^"pink^"><p align=^"center^"><font size=^"5^"><b>%L</b></font></p align>", id, "STATS_MONEY", id, "STATS_MONEY_1", kasa_gracza[id], nowa_kasa_gracza[id], id, "ULTRA_POINTS")
  1005. Len += format(txt[Len], (sizeof txt - 1) - Len, "<p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L <p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L ", id, "STATS_INVISIBLE", id, "STATS_INVISIBLE_1", niewidzialnosc_gracza[id], nniewidzialnosc, id, "STATS_DAMAGE", id, "STATS_DAMAGE_1", obrazenia_gracza[id], nowe_obrazenia_gracza[id])
  1006. Len += format(txt[Len], (sizeof txt - 1) - Len, "<p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L <p><font size=^"4^"><font color=^"#CBCBCB^">%L <font color=^"red^">%L ", id, "STATS_JUMPS", id, "STATS_JUMPS_1", skoki_gracza[id], nowe_skoki_gracza[id], id, "STATS_LONG_JUMP", id, "STATS_LONG_JUMP_1", longjump_gracza[id], nowy_longujmp_gracza[id], longjump_s_czas[id])
  1007.  
  1008. show_motd(id, txt)
  1009. }
  1010. ///////////////////////////////////////////////////////
  1011.  
  1012. public MenuPrzydzielUltraPunkty(id)
  1013. {
  1014. if(!is_user_connected(id))
  1015. return PLUGIN_CONTINUE
  1016.  
  1017. client_cmd(id, "spk %s", menu_on)
  1018. new uprzydziel[128], niewidzialnosc[128], obrazenia[128], skoki[128], longjump[150]
  1019.  
  1020. new ileMa = nowa_niewidzialnosc_gracza[id], ilePotrzeba = 255, ilePotrzebaBylo = 0;
  1021. new Float:fProcent = 0.0;
  1022.  
  1023. fProcent = (float((ileMa - ilePotrzebaBylo)) / float((ilePotrzeba - ilePotrzebaBylo))) * 100.0;
  1024.  
  1025. formatex(uprzydziel, 127, "%L", id, "MENU_ADD_UPOINTS_TITLE", ultra_punkty_gracza[id])
  1026. formatex(niewidzialnosc, 127, "%L", id, "MENU_ADD_UPOINTS_INVISIBLE", niewidzialnosc_gracza[id], fProcent)
  1027. formatex(obrazenia, 127, "%L",id, "MENU_ADD_UPOINTS_DAMAGE", obrazenia_gracza[id], nowe_obrazenia_gracza[id])
  1028. formatex(skoki, 127, "%L", id, "MENU_ADD_UPOINTS_JUMPS", skoki_gracza[id], nowe_skoki_gracza[id])
  1029. formatex(longjump, 149, "%L", id, "MENU_ADD_UPOINTS_LONG_JUMP", longjump_gracza[id], nowy_longujmp_gracza[id], longjump_s_czas[id])
  1030.  
  1031. new menu_upunkty = menu_create(uprzydziel, "MenuPrzydzielUltraPunkty_Wb")
  1032. new menu_upunkty_cb = menu_makecallback("MenuPrzydzielUltraPunkty_CB")
  1033.  
  1034. menu_additem(menu_upunkty, niewidzialnosc, _, _, menu_upunkty_cb)
  1035. menu_additem(menu_upunkty, obrazenia, _, _, menu_upunkty_cb)
  1036. menu_additem(menu_upunkty, skoki , _, _, menu_upunkty_cb)
  1037. menu_additem(menu_upunkty, longjump , _, _, menu_upunkty_cb)
  1038.  
  1039. menu_setprop(menu_upunkty, MPROP_NUMBER_COLOR,"\r");
  1040. menu_display(id, menu_upunkty)
  1041. if(get_pcvar_num(p_exp_boty) == 1)
  1042. {
  1043. if(is_user_bot(id))
  1044. {
  1045. MenuPrzydzielUltraPunkty_Wb(id, menu_upunkty, random_num(0, 3))
  1046. }
  1047. }
  1048. return PLUGIN_CONTINUE
  1049. }
  1050.  
  1051. public MenuPrzydzielUltraPunkty_CB(id, menu_upunkty, item_upunkty)
  1052. {
  1053. if((item_upunkty == 0 && niewidzialnosc_gracza[id] >= MAX_ULTRA_PUNKTOW) || (item_upunkty == 1 && obrazenia_gracza[id] >= MAX_ULTRA_PUNKTOW) || (item_upunkty == 2 && skoki_gracza[id] >= MAX_ULTRA_PUNKTOW) || (item_upunkty == 3 && longjump_gracza[id] >= MAX_ULTRA_PUNKTOW))
  1054. return ITEM_DISABLED
  1055. return ITEM_ENABLED
  1056. }
  1057. public MenuPrzydzielUltraPunkty_Wb(id, menu_upunkty, item_upunkty)
  1058. {
  1059. if(item_upunkty == MENU_EXIT || !is_user_connected(id))
  1060. {
  1061. if(punkty_gracza[id] > 0)
  1062. MenuWybor(id)
  1063.  
  1064. menu_destroy(menu_upunkty)
  1065. return PLUGIN_CONTINUE
  1066. }
  1067.  
  1068. switch(item_upunkty)
  1069. {
  1070. case 0:
  1071. {
  1072. ultra_punkty_gracza[id]--
  1073. niewidzialnosc_gracza[id]++
  1074. nowa_niewidzialnosc_gracza[id] = niewidzialnosc_gracza[id]*MNOZNIK_NIEWIDZIALNOSCI
  1075. }
  1076. case 1:
  1077. {
  1078. ultra_punkty_gracza[id]--
  1079. obrazenia_gracza[id]++
  1080. nowe_obrazenia_gracza[id] = obrazenia_gracza[id]*MNOZNIK_OBRAZEN
  1081. }
  1082. case 2:
  1083. {
  1084. ultra_punkty_gracza[id]--
  1085. skoki_gracza[id]++
  1086. nowe_skoki_gracza[id] = skoki_gracza[id]*MNOZNIK_SKOKOW
  1087. }
  1088. case 3:
  1089. {
  1090. ultra_punkty_gracza[id]--
  1091. longjump_gracza[id]++
  1092. nowy_longujmp_gracza[id] = longjump_gracza[id]*MNOZNIK_LONGJUMPA
  1093. longjump_s_czas[id] = (14-longjump_gracza[id]*2)
  1094. }
  1095. }
  1096. switch(random_num(1,2))
  1097. {
  1098. case 1:client_cmd(id, "spk %s", klik)
  1099. case 2:client_cmd(id, "spk %s", klik2)
  1100. }
  1101.  
  1102.  
  1103. if(ultra_punkty_gracza[id] > 0)
  1104. MenuPrzydzielUltraPunkty(id)
  1105. else if(punkty_gracza[id] > 0 )
  1106. MenuWybor(id)
  1107.  
  1108. return PLUGIN_CONTINUE
  1109. }
  1110.  
  1111. ///////////////////////////////////////////////////////
  1112.  
  1113.  
  1114. public MenuPrzydzielPunkty(id)
  1115. {
  1116. if(!is_user_connected(id))
  1117. return PLUGIN_CONTINUE
  1118.  
  1119. client_cmd(id, "spk %s", menu_on)
  1120.  
  1121. new przydziel[33], hp[64], szybkosc[64], grawitacja[64], kasa[64], hp1[64], sz[64], gr[64], ka[64];
  1122.  
  1123. new ileMa = floatround(nowa_szybkosc_gracza[id]), ilePotrzeba = 105, ilePotrzebaBylo = 0;
  1124. new Float:fProcent = 0.0;
  1125.  
  1126. new ile_ma = floatround(nowa_grawitacja_gracza[id])
  1127. new ile_potrzeba = 800
  1128. new ile_potrzeba_bylo = 0;
  1129. new Float:procent = 0.0;
  1130.  
  1131. fProcent = (float((ileMa - ilePotrzebaBylo)) / float((ilePotrzeba - ilePotrzebaBylo))) * 100.0;
  1132. procent = (float((ile_ma - ile_potrzeba_bylo)) / float((ile_potrzeba - ile_potrzeba_bylo))) * 100.0;
  1133.  
  1134. formatex(przydziel, 32, "%L", id, "MENU_ADD_POINTS_TITLE", punkty_gracza[id])
  1135. formatex(hp, 63, "%L", id, "MENU_ADD_POINTS_HEALTH", zycie_gracza[id], nowe_zycie_gracza[id])
  1136. formatex(szybkosc, 63, "%L", id, "MENU_ADD_POINTS_SPEED", szybkosc_gracza[id], fProcent)
  1137. formatex(grawitacja, 63, "%L", id, "MENU_ADD_POINTS_GRAVITY", grawitacja_gracza[id], procent)
  1138. formatex(kasa, 63, "%L", id, "MENU_ADD_POINTS_MONEY", kasa_gracza[id], nowa_kasa_gracza[id])
  1139. formatex(hp1, 63, "%L", id, "MENU_ADD_POINTS_HEALTH_5")
  1140. formatex(sz, 63, "%L", id, "MENU_ADD_POINTS_SPEED_5")
  1141. formatex(gr, 63, "%L", id, "MENU_ADD_POINTS_GRAVITY_5")
  1142. formatex(ka, 63, "%L", id, "MENU_ADD_POINTS_MONEY_5")
  1143.  
  1144. new menu_punkty_cb = menu_makecallback("MenuPrzydzielPunkty_CallBack")
  1145.  
  1146. new menu_punkty = menu_create(przydziel, "MenuPrzydzielPunkty_Wybieranie")
  1147. menu_additem(menu_punkty, hp, _, _, menu_punkty_cb)
  1148. menu_additem(menu_punkty, szybkosc, _, _, menu_punkty_cb)
  1149. menu_additem(menu_punkty, grawitacja, _, _, menu_punkty_cb)
  1150. menu_additem(menu_punkty, kasa, _, _, menu_punkty_cb)
  1151. menu_additem(menu_punkty, hp1, _, _, menu_punkty_cb)
  1152. menu_additem(menu_punkty, sz, _, _, menu_punkty_cb)
  1153. menu_additem(menu_punkty, gr, _, _, menu_punkty_cb)
  1154. menu_additem(menu_punkty, ka, _, _, menu_punkty_cb)
  1155.  
  1156. menu_setprop(menu_punkty, MPROP_NUMBER_COLOR,"\r");
  1157. menu_display(id, menu_punkty)
  1158. if(get_pcvar_num(p_exp_boty) == 1)
  1159. {
  1160. if(is_user_bot(id))
  1161. {
  1162. if(punkty_gracza[id] > 0)
  1163. MenuPrzydzielPunkty_Wybieranie(id, menu_punkty, random_num(0, 3))
  1164. else if(punkty_gracza[id] <= 0 && ultra_punkty_gracza[id] > 0)
  1165. MenuPrzydzielUltraPunkty(id)
  1166. }
  1167. }
  1168. return PLUGIN_CONTINUE
  1169. }
  1170.  
  1171. public MenuPrzydzielPunkty_CallBack(id, menu_punkty, item_punkty)
  1172. {
  1173. if((item_punkty == 0 && zycie_gracza[id] >= MAX_PUNKTOW) || (item_punkty == 1 && szybkosc_gracza[id] >= MAX_PUNKTOW) || (item_punkty == 2 && grawitacja_gracza[id] >= MAX_PUNKTOW) || (item_punkty == 3 && kasa_gracza[id] >= MAX_PUNKTOW))
  1174. {
  1175. return ITEM_DISABLED
  1176. }
  1177. if((item_punkty == 4 && zycie_gracza[id]+5 >= MAX_PUNKTOW) ||(item_punkty == 5 && szybkosc_gracza[id]+5 >= MAX_PUNKTOW) ||(item_punkty == 6 && grawitacja_gracza[id]+5 >= MAX_PUNKTOW) ||(item_punkty == 7 && kasa_gracza[id]+5 >= MAX_PUNKTOW))
  1178. return ITEM_DISABLED
  1179. for(new i = 4 ; i < 8 ;i++)
  1180. {
  1181. if(item_punkty == i && punkty_gracza[id] < 5)
  1182. return ITEM_DISABLED
  1183. }
  1184.  
  1185. return ITEM_ENABLED
  1186.  
  1187. }
  1188.  
  1189. ///////////////////////////////////////////////////////
  1190.  
  1191. public plugin_cfg()
  1192. {
  1193. server_cmd("sv_maxspeed 9999")
  1194.  
  1195. plik = nvault_open("ExpMod")
  1196.  
  1197. if(plik != INVALID_HANDLE)
  1198. nvault_prune(plik , 0 , get_systime() - ( 14 * 86400 ) ); // 14 - liczba dni po których usuwa stare dane ( 2 tyg )
  1199. else
  1200. log_amx("Nie mozna otworzyæ pliku nvault: ^"ExpMod^"")
  1201. }
  1202.  
  1203. ///////////////////////////////////////////////////////
  1204.  
  1205. public CmdStart(id, uc_handle)
  1206. {
  1207. if(!is_user_alive(id) || !is_user_connected(id))
  1208. return FMRES_IGNORED;
  1209.  
  1210. new button = get_uc(uc_handle, UC_Buttons);
  1211. new oldbutton = get_user_oldbutton(id);
  1212. new flags = get_entity_flags(id);
  1213.  
  1214. // Skoki
  1215.  
  1216. if(skoki_gracza[id] > 0)
  1217. {
  1218. if(is_user_bot(id) && get_pcvar_num(p_exp_boty) == 1 && (button & IN_JUMP))
  1219. set_task(0.4, "BotySkocz")
  1220.  
  1221. if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && nowe_skoki_gracza[id] > 0)
  1222. {
  1223. nowe_skoki_gracza[id]--;
  1224. if(nowe_skoki_gracza[id] > 0)
  1225. client_print(id, print_center, "%L", id, "MSG_USE_SKILL_JUMP", nowe_skoki_gracza[id])
  1226.  
  1227. new Float:velocity[3];
  1228. entity_get_vector(id,EV_VEC_velocity,velocity);
  1229. velocity[2] = random_float(265.0,285.0);
  1230. entity_set_vector(id,EV_VEC_velocity,velocity);
  1231. }
  1232. else if(flags & FL_ONGROUND)
  1233. {
  1234. nowe_skoki_gracza[id] = skoki_gracza[id]*MNOZNIK_SKOKOW
  1235. }
  1236. }
  1237.  
  1238. //Long Jump
  1239.  
  1240. if(longjump_gracza[id] > 0 && (button & IN_JUMP) && (button & IN_DUCK) && get_gametime() > (longjump_czas[id]+float((longjump_s_czas[id]))) && !ft)
  1241. {
  1242. longjump_czas[id] = floatround(get_gametime())
  1243. client_print(id, print_center, "%L", id, "MSG_USE_SKILL_LONG_JUMP", longjump_s_czas[id])
  1244. new Float:velocity[3]
  1245. VelocityByAim(id, 700, velocity);
  1246. velocity[2] = (162.5+float(nowy_longujmp_gracza[id]))
  1247. entity_set_vector(id, EV_VEC_velocity, velocity);
  1248. }
  1249.  
  1250. return FMRES_IGNORED;
  1251. }
  1252.  
  1253. public BotySkocz(id)
  1254. {
  1255. if(is_user_bot(id))
  1256. {
  1257. client_cmd(id, "-jump")
  1258. client_cmd(id, "+jump")
  1259. }
  1260. }
  1261. ///////////////////////////////////////////////////////
  1262.  
  1263.  
  1264. public MenuPrzydzielPunkty_Wybieranie(id, menu_punkty, item_punkty)
  1265. {
  1266. if(item_punkty == MENU_EXIT || !is_user_connected(id))
  1267. {
  1268. if(ultra_punkty_gracza[id] > 0)
  1269. MenuPrzydzielUltraPunkty(id)
  1270.  
  1271. menu_destroy(menu_punkty)
  1272. return PLUGIN_CONTINUE
  1273. }
  1274.  
  1275. switch(item_punkty)
  1276. {
  1277. case 0:
  1278. {
  1279. punkty_gracza[id]--
  1280. zycie_gracza[id]++
  1281. nowe_zycie_gracza[id] = zycie_gracza[id]*MNOZNIK_ZYCIA
  1282. }
  1283. case 1:
  1284. {
  1285. punkty_gracza[id]--
  1286. szybkosc_gracza[id]++
  1287. nowa_szybkosc_gracza[id] = szybkosc_gracza[id]*MNOZNIK_SZYBKOSCI
  1288. }
  1289. case 2:
  1290. {
  1291. punkty_gracza[id]--
  1292. grawitacja_gracza[id]++
  1293. nowa_grawitacja_gracza[id] = grawitacja_gracza[id]*MNOZNIK_GRAWITACJI
  1294. }
  1295. case 3:
  1296. {
  1297. punkty_gracza[id]--
  1298. kasa_gracza[id]++
  1299. nowa_kasa_gracza[id] = kasa_gracza[id]*MNOZNIK_KASY
  1300. }
  1301. case 4:
  1302. {
  1303. punkty_gracza[id]-=5
  1304. zycie_gracza[id]+=5
  1305. nowe_zycie_gracza[id] = zycie_gracza[id]*MNOZNIK_ZYCIA
  1306. }
  1307. case 5:
  1308. {
  1309. punkty_gracza[id]-=5
  1310. szybkosc_gracza[id]+=5
  1311. nowa_szybkosc_gracza[id] = szybkosc_gracza[id]*MNOZNIK_SZYBKOSCI
  1312. }
  1313. case 6:
  1314. {
  1315. punkty_gracza[id]-=5
  1316. grawitacja_gracza[id]+=5
  1317. nowa_grawitacja_gracza[id] = grawitacja_gracza[id]*MNOZNIK_GRAWITACJI
  1318. }
  1319. case 7:
  1320. {
  1321. punkty_gracza[id]-=5
  1322. kasa_gracza[id]+=5
  1323. nowa_kasa_gracza[id] = kasa_gracza[id]*MNOZNIK_KASY
  1324. }
  1325. }
  1326.  
  1327. switch(random_num(1,2))
  1328. {
  1329. case 1:client_cmd(id, "spk %s", klik)
  1330. case 2:client_cmd(id, "spk %s", klik2)
  1331. }
  1332.  
  1333. if(punkty_gracza[id] > 0)
  1334. MenuPrzydzielPunkty(id)
  1335. else if(ultra_punkty_gracza[id] > 0 )
  1336. MenuWybor(id)
  1337.  
  1338. return PLUGIN_CONTINUE
  1339. }
  1340.  
  1341. ///////////////////////////////////////////////////////
  1342.  
  1343. public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
  1344. {
  1345. if(!is_user_alive(this) || !is_user_connected(this) || !is_user_connected(idattacker))
  1346. return HAM_IGNORED
  1347.  
  1348. //new zycie = get_user_health(this);
  1349. //new bron = get_user_weapon(idattacker);
  1350.  
  1351.  
  1352. if(obrazenia_gracza[idattacker] > 0)
  1353. damage+=nowe_obrazenia_gracza[idattacker]
  1354.  
  1355. SetHamParamFloat(4, damage);
  1356. return HAM_IGNORED;
  1357. }
  1358.  
  1359. new ids[33];
  1360. public MenuAdmin(id)
  1361. {
  1362. new title[64];
  1363. formatex(title, 63, "%L", id, "MENU_ADMIN_TITLE")
  1364. new menu = menu_create(title, "MenuAdmin1")
  1365. new nick[33]
  1366. new player;
  1367. for(new i = 1; i < 33;i++)
  1368. {
  1369. if(!is_user_connected(i) || is_user_hltv(i))
  1370. continue;
  1371.  
  1372. ids[player] = i;
  1373.  
  1374. player ++;
  1375. get_user_name(i, nick, 32)
  1376. menu_additem(menu, nick)
  1377. }
  1378. menu_display(id, menu)
  1379. }
  1380.  
  1381. public MenuAdmin1(id, menu, item)
  1382. {
  1383. if(item == MENU_EXIT)
  1384. {
  1385. menu_destroy(menu)
  1386. return PLUGIN_CONTINUE
  1387. }
  1388.  
  1389. switch(random_num(1,2))
  1390. {
  1391. case 1:client_cmd(id, "spk %s", klik)
  1392. case 2:client_cmd(id, "spk %s", klik2)
  1393. }
  1394.  
  1395. id_am = ids[item];
  1396.  
  1397. new title[256], nick[33], misja[64]
  1398. new a1[64], a2[64], a3[64], a4[64], a5[64], a6[64], a7[64], a8[64];
  1399. exp_get_mission_name(exp_get_user_mission(id_am), misja, 63)
  1400. get_user_name(id_am, nick, 32)
  1401.  
  1402. formatex(title, 256, "%L", id, "MENU_ADMIN_TITLE1", nick, poziom_gracza[id_am], doswiadczenie_gracza[id_am], monety_gracza[id_am], misja)
  1403. formatex(a1, 63, "%L", id, "MENU_ADMIN_ADD_LEVEL")
  1404. formatex(a2, 63, "%L", id, "MENU_ADMIN_ADD_EXP")
  1405. formatex(a3, 63, "%L", id, "MENU_ADMIN_ADD_MONETS")
  1406. formatex(a4, 63, "%L", id, "MENU_ADMIN_SET_LEVEL")
  1407. formatex(a5, 63, "%L", id, "MENU_ADMIN_SET_EXP")
  1408. formatex(a6, 63, "%L", id, "MENU_ADMIN_SET_MONETS")
  1409. formatex(a7, 63, "%L", id, "MENU_ADMIN_MANAGING_MISSIONS")
  1410. formatex(a8, 63, "%L", id, "MENU_ADMIN_RELOAD_CFG")
  1411.  
  1412. new menus = menu_create(title, "MenuAdmin2")
  1413.  
  1414. menu_additem(menus, a1)
  1415. menu_additem(menus, a2)
  1416. menu_additem(menus, a3)
  1417. menu_additem(menus, a4)
  1418. menu_additem(menus, a5)
  1419. menu_additem(menus, a6)
  1420. menu_additem(menus, a7)
  1421. menu_additem(menus, a8)
  1422.  
  1423. menu_display(id, menus)
  1424.  
  1425. return PLUGIN_CONTINUE
  1426. }
  1427. public MenuAdmin2(id, menu, item)
  1428. {
  1429. if(item == MENU_EXIT)
  1430. {
  1431. menu_destroy(menu)
  1432. return PLUGIN_CONTINUE
  1433. }
  1434. switch(item)
  1435. {
  1436. case 0:MenuAdminDodajPoziom(id)
  1437.  
  1438. case 1:MenuAdminDodajExp(id)
  1439.  
  1440. case 2:MenuAdminDodajMonety(id)
  1441.  
  1442. case 3:MenuAdminUstawPoziom(id)
  1443.  
  1444. case 4:MenuAdminUstawExp(id)
  1445.  
  1446. case 5:MenuAdminUstawMonety(id)
  1447.  
  1448. case 6:MenuAdminZarzadzajMisjami(id)
  1449.  
  1450. case 7:
  1451. {
  1452. WczytajUstawienia()
  1453. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MENU_ADMIN_RELOAD_CFG_SUCCES")
  1454. }
  1455. }
  1456. return PLUGIN_CONTINUE
  1457. }
  1458. new id_misji;
  1459. public MenuAdminZarzadzajMisjami(id)
  1460. {
  1461. new title[64]
  1462. formatex(title, 63, "%L", id, "MENU_ADMIN_SELECT_MISSION")
  1463. new menu = menu_create(title, "MenuAdminZarzadzajMisjami1"), misja[64]
  1464.  
  1465. for(new i = 1; i <= exp_get_missions_numbers(); i++)
  1466. {
  1467. exp_get_mission_name(i, misja, 63)
  1468. menu_additem(menu, misja)
  1469. }
  1470. menu_display(id, menu)
  1471. }
  1472. public MenuAdminZarzadzajMisjami1(id, menu, item)
  1473. {
  1474. if(item == MENU_EXIT)
  1475. {
  1476. menu_destroy(menu)
  1477. return PLUGIN_CONTINUE
  1478. }
  1479. item++
  1480. id_misji = item;
  1481. new misja[64], title[128], nick[33], usta[64], odblo[64], anulo[64], zabloko[64], anulizablo[64]
  1482. formatex(usta, 63, "%L", id, "MENU_ADMIN_MISSION_SET")
  1483. formatex(odblo, 63, "%L", id, "MENU_ADMIN_MISSION_UNLOCK")
  1484. formatex(anulo, 63, "%L", id, "MENU_ADMIN_MISSION_CANCEL")
  1485. formatex(zabloko, 63, "%L", id, "MENU_ADMIN_MISSION_LOCK")
  1486. formatex(anulizablo, 63, "%L", id, "MENU_ADMIN_MISSION_CANCEL_AND_LOCK")
  1487. get_user_name(id_am, nick, 32)
  1488. exp_get_mission_name(item, misja, 63)
  1489.  
  1490. formatex(title, 128, "Co chcesz zrobic z misja:^n\r%s\w, dla gracza:^n\r%s^n\y?", misja, nick)
  1491. new menu = menu_create(title, "MenuAdminZarzadzajMisjami2");
  1492.  
  1493. new menu_cb = menu_makecallback("MenuAdminZarzadzajMisjamiCb");
  1494.  
  1495. menu_additem(menu, usta, _, _, menu_cb)
  1496. menu_additem(menu, odblo, _, _, menu_cb)
  1497. menu_additem(menu, anulo, _, _, menu_cb)
  1498. menu_additem(menu, zabloko, _, _, menu_cb)
  1499. menu_additem(menu, anulizablo, _, _, menu_cb)
  1500.  
  1501. menu_display(id, menu)
  1502. return PLUGIN_CONTINUE
  1503. }
  1504. public MenuAdminZarzadzajMisjamiCb(id, menu, item)
  1505. {
  1506. if(item == 0 && exp_get_user_mission(id_am) == id_misji)
  1507. return ITEM_DISABLED
  1508. if(item == 1 && exp_get_mission_status(id_am, id_misji) == 0)
  1509. return ITEM_DISABLED
  1510. if(item == 2 && exp_get_user_mission(id_am) != id_misji)
  1511. return ITEM_DISABLED
  1512. if(item == 3 && exp_get_mission_status(id_am, id_misji) == 1)
  1513. return ITEM_DISABLED
  1514. if(item == 4 && exp_get_user_mission(id_am) != id_misji)
  1515. return ITEM_DISABLED
  1516.  
  1517. return ITEM_ENABLED
  1518. }
  1519. public MenuAdminZarzadzajMisjami2(id, menu, item)
  1520. {
  1521. if(item == MENU_EXIT)
  1522. {
  1523. menu_destroy(menu)
  1524. return PLUGIN_CONTINUE
  1525. }
  1526. new nick[33], misja[64]
  1527. get_user_name(id, adminek, 32)
  1528. get_user_name(id_am, nick, 32)
  1529. exp_get_mission_name(id_misji, misja, 63)
  1530.  
  1531. if(item == 0)
  1532. {
  1533. exp_set_user_mission(id_am, id_misji, 0)
  1534. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_SET_MISSION", adminek, misja, nick)
  1535. }
  1536. if(item == 1)
  1537. {
  1538. exp_set_mission_status(id_am, id_misji, 0)
  1539. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_UNLOCK_MISSION", adminek, misja, nick)
  1540. }
  1541. if(item == 2)
  1542. {
  1543. exp_set_user_mission(id_am, 0, 0)
  1544. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_CANCEL_MISSION", adminek, misja, nick)
  1545. }
  1546. if(item == 3)
  1547. {
  1548. exp_set_mission_status(id_am, id_misji, 1)
  1549. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_LOCK_MISSION", adminek, misja, nick)
  1550. }
  1551. if(item == 4)
  1552. {
  1553. exp_set_mission_status(id_am, id_misji, 1)
  1554. exp_set_user_mission(id_am, 0, 0)
  1555. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_CANCEL_AND_LOCK_MISSION", adminek, misja, nick)
  1556. }
  1557. return PLUGIN_CONTINUE
  1558. }
  1559. public MenuAdminDodajPoziom(id)
  1560. {
  1561. get_user_name(id, adminek, 32)
  1562. client_cmd(id, "messagemode dodaj_lvl");
  1563. }
  1564.  
  1565. public dodaj_lvl()
  1566. {
  1567. new gracz[33]
  1568. get_user_name(id_am, gracz, 32)
  1569.  
  1570. new liczba_lvl[10]
  1571. read_args(liczba_lvl, 9)
  1572. remove_quotes(liczba_lvl)
  1573.  
  1574.  
  1575. if(str_to_num(liczba_lvl) > 200)
  1576. {
  1577. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_HIGH_ERROR")
  1578. return PLUGIN_CONTINUE
  1579. }
  1580. if(str_to_num(liczba_lvl) < 1)
  1581. {
  1582. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1583. return PLUGIN_CONTINUE
  1584. }
  1585.  
  1586. poziom_gracza[id_am] += str_to_num(liczba_lvl)
  1587.  
  1588. doswiadczenie_gracza[id_am] = POZIOM[poziom_gracza[id_am]]
  1589.  
  1590. Zresetuj(id_am, 1, 1, 1)
  1591. SprawdzExp(id_am)
  1592.  
  1593. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_ADD_LEVEL", adminek, str_to_num(liczba_lvl), gracz)
  1594.  
  1595. return PLUGIN_CONTINUE
  1596. }
  1597.  
  1598. public MenuAdminDodajExp(id)
  1599. {
  1600. get_user_name(id, adminek, 32)
  1601. console_cmd(id, "messagemode dodaj_exp");
  1602. }
  1603.  
  1604. public dodaj_exp()
  1605. {
  1606. new gracz[33]
  1607. get_user_name(id_am, gracz, 32)
  1608.  
  1609. new liczba_exp[10]
  1610. read_args(liczba_exp, 9)
  1611. remove_quotes(liczba_exp)
  1612.  
  1613. if(doswiadczenie_gracza[id_am]+str_to_num(liczba_exp) > POZIOM[199])
  1614. {
  1615. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_HIGH_ERROR")
  1616. return PLUGIN_CONTINUE
  1617. }
  1618. else if(str_to_num(liczba_exp) <= 0)
  1619. {
  1620. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1621. return PLUGIN_CONTINUE
  1622. }
  1623.  
  1624. doswiadczenie_gracza[id_am] += str_to_num(liczba_exp)
  1625.  
  1626. Zresetuj(id_am, 1, 1, 1)
  1627. SprawdzExp(id_am)
  1628.  
  1629. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_ADD_EXP", adminek, str_to_num(liczba_exp), gracz)
  1630.  
  1631. return PLUGIN_CONTINUE
  1632. }
  1633. public MenuAdminDodajMonety(id)
  1634. {
  1635. get_user_name(id, adminek, 32)
  1636. console_cmd(id, "messagemode dodaj_monety");
  1637. }
  1638.  
  1639. public dodaj_monety()
  1640. {
  1641. new gracz[33]
  1642. get_user_name(id_am, gracz, 32)
  1643.  
  1644. new liczba_monet[10]
  1645. read_args(liczba_monet, 9)
  1646. remove_quotes(liczba_monet)
  1647.  
  1648. if(str_to_num(liczba_monet) <= 0)
  1649. {
  1650. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1651. return PLUGIN_CONTINUE
  1652. }
  1653.  
  1654. monety_gracza[id_am] += str_to_num(liczba_monet)
  1655.  
  1656. SprawdzExp(id_am)
  1657.  
  1658.  
  1659. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_ADD_MONETS", adminek, str_to_num(liczba_monet), gracz)
  1660.  
  1661. return PLUGIN_CONTINUE
  1662. }
  1663.  
  1664. public MenuAdminUstawMonety(id)
  1665. {
  1666. get_user_name(id, adminek, 32)
  1667. console_cmd(id, "messagemode ustaw_monety");
  1668. }
  1669. public ustaw_monety()
  1670. {
  1671. new gracz[33]
  1672. get_user_name(id_am, gracz, 32)
  1673.  
  1674. new liczba_monet[10]
  1675. read_args(liczba_monet, 9)
  1676. remove_quotes(liczba_monet)
  1677.  
  1678. if(str_to_num(liczba_monet) < 0)
  1679. {
  1680. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1681. return PLUGIN_CONTINUE
  1682. }
  1683.  
  1684. monety_gracza[id_am] = str_to_num(liczba_monet)
  1685.  
  1686.  
  1687. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_SET_MONETS", adminek, str_to_num(liczba_monet), gracz)
  1688.  
  1689. return PLUGIN_CONTINUE
  1690. }
  1691.  
  1692. public MenuAdminUstawExp(id)
  1693. {
  1694. get_user_name(id, adminek, 32)
  1695. console_cmd(id, "messagemode ustaw_exp");
  1696. }
  1697.  
  1698. public ustaw_exp()
  1699. {
  1700. new gracz[33]
  1701. get_user_name(id_am, gracz, 32)
  1702.  
  1703. new liczba_exp[15]
  1704. read_args(liczba_exp, 14)
  1705. remove_quotes(liczba_exp)
  1706.  
  1707. if(str_to_num(liczba_exp) > POZIOM[199])
  1708. {
  1709. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_HIGH_ERROR")
  1710. return PLUGIN_CONTINUE
  1711. }
  1712. if(str_to_num(liczba_exp) < 1)
  1713. {
  1714. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1715. return PLUGIN_CONTINUE
  1716. }
  1717.  
  1718. doswiadczenie_gracza[id_am] = str_to_num(liczba_exp)
  1719.  
  1720. Zresetuj(id_am, 1, 1, 1)
  1721.  
  1722. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_SET_EXP", adminek, str_to_num(liczba_exp), gracz)
  1723.  
  1724. SprawdzExp(id_am)
  1725. return PLUGIN_CONTINUE
  1726. }
  1727. public MenuAdminUstawPoziom(id)
  1728. {
  1729.  
  1730. get_user_name(id, adminek, 32)
  1731. console_cmd(id, "messagemode ustaw_lvl");
  1732.  
  1733. }
  1734. public ustaw_lvl()
  1735. {
  1736. new lvl[10]
  1737. read_args(lvl, 9)
  1738. remove_quotes(lvl)
  1739.  
  1740. new gracz[33]
  1741. get_user_name(id_am, gracz, 32)
  1742.  
  1743. new str = str_to_num(lvl)
  1744.  
  1745. if(str > 199)
  1746. {
  1747. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_HIGH_ERROR")
  1748. return PLUGIN_CONTINUE
  1749. }
  1750. if(str < 1)
  1751. {
  1752. ColorChat(get_user_index(adminek), GREEN, "%s^x01 %L", prefix, adminek, "MSG_ADMIN_TOO_LOW_ERROR")
  1753. return PLUGIN_CONTINUE
  1754. }
  1755. poziom_gracza[id_am] = str_to_num(lvl)
  1756. doswiadczenie_gracza[id_am] = POZIOM[poziom_gracza[id_am]]
  1757.  
  1758. Zresetuj(id_am, 1, 1, 1)
  1759. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_ADMIN_SET_LEVEL", adminek, str, gracz)
  1760.  
  1761. return PLUGIN_CONTINUE
  1762. }
  1763. ///////////////////////////////////////////////////////
  1764.  
  1765. public Zresetuj(index, punkty, upunkty, monety)
  1766. {
  1767. if(punkty)
  1768. {
  1769. punkty_gracza[index] = poziom_gracza[index]*PUNKTY_ZA_LEVEL
  1770.  
  1771. zycie_gracza[index] = 0
  1772. nowe_zycie_gracza[index] = 0
  1773.  
  1774. szybkosc_gracza[index] = 0
  1775. nowa_szybkosc_gracza[index] = 0.0
  1776.  
  1777. grawitacja_gracza[index] = 0
  1778. nowa_grawitacja_gracza[index] = 0.0
  1779.  
  1780. kasa_gracza[index] = 0
  1781. nowa_kasa_gracza[index] = 0
  1782. }
  1783. if(upunkty)
  1784. {
  1785. ultra_punkty_gracza[index] = floatround(float(poziom_gracza[index]/10), floatround_floor)
  1786. niewidzialnosc_gracza[index] = 0
  1787. nowa_niewidzialnosc_gracza[index] = 0
  1788.  
  1789. obrazenia_gracza[index] = 0
  1790. nowe_obrazenia_gracza[index] = 0
  1791.  
  1792. skoki_gracza[index] = 0
  1793. nowe_skoki_gracza[index] = 0
  1794.  
  1795. longjump_gracza[index] = 0
  1796. nowy_longujmp_gracza[index] = 0
  1797. longjump_s_czas[index] = 0
  1798. }
  1799. if(monety)
  1800. monety_gracza[index] = 0
  1801. }
  1802.  
  1803. public DeathMsg()
  1804. {
  1805. new atakujacy = read_data(1);
  1806. new obronca = read_data(2);
  1807. new hs = read_data(3)
  1808. new czy[33]
  1809. if(!is_user_connected(atakujacy) || !is_user_connected(obronca) || get_playersnum() < get_pcvar_num(p_exp_of_players))
  1810. return PLUGIN_CONTINUE
  1811. if(atakujacy != obronca && is_user_connected(atakujacy) && get_user_team(atakujacy) != get_user_team(obronca))
  1812. {
  1813. if(hs > 0)
  1814. {
  1815. czy[atakujacy]++
  1816. }
  1817.  
  1818. ///////////////////////PO HEADSHOCIE////////////////////////
  1819.  
  1820. if(czy[atakujacy] != 1)
  1821. {
  1822. if(get_user_flags(atakujacy) & VIP_FLAG)
  1823. {
  1824. doswiadczenie_gracza[atakujacy]+=(get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_vip_extra_exp)
  1825.  
  1826. set_hudmessage(255, 255, 255, -1.0, 0.62, 0, 6.0, 2.0)
  1827. show_hudmessage(atakujacy, "+%d exp", (get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_vip_extra_exp))
  1828. }
  1829. else
  1830. {
  1831. doswiadczenie_gracza[atakujacy]+=(get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))
  1832.  
  1833. set_hudmessage(255, 255, 255, -1.0, 0.62, 0, 6.0, 2.0)
  1834. show_hudmessage(atakujacy, "+%d exp", (get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1])))
  1835. }
  1836.  
  1837. //if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  1838. //tutorMake(atakujacy, TUTOR_RED, 1.5, "Zabiles wroga")
  1839.  
  1840. }
  1841. else if(czy[atakujacy] == 1)
  1842. {
  1843. if(get_user_flags(atakujacy) & VIP_FLAG)
  1844. {
  1845. doswiadczenie_gracza[atakujacy]+=((get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_headshot)+get_pcvar_num(p_exp_vip_extra_hs_exp))
  1846.  
  1847. set_hudmessage(255, 255, 255, -1.0, 0.62, 0, 6.0, 2.0)
  1848. show_hudmessage(atakujacy, "+%d exp^nHEADSHOT", (get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_headshot)+get_pcvar_num(p_exp_vip_extra_hs_exp))
  1849. }
  1850. else
  1851. {
  1852. doswiadczenie_gracza[atakujacy]+=((get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_headshot))
  1853.  
  1854. set_hudmessage(255, 255, 255, -1.0, 0.62, 0, 6.0, 2.0)
  1855. show_hudmessage(atakujacy, "+%d exp^nHEADSHOT", (get_user_team(atakujacy) == 1 ? get_pcvar_num(p_exp_zabojstwo[0]) : get_pcvar_num(p_exp_zabojstwo[1]))+get_pcvar_num(p_exp_headshot))
  1856. }
  1857.  
  1858. czy[atakujacy] = 0
  1859.  
  1860. //if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  1861. //tutorMake(atakujacy, TUTOR_RED, 1.5, "Zabiles wroga Headshotem")
  1862. }
  1863.  
  1864. if(get_user_flags(atakujacy) & VIP_FLAG)
  1865. monety_gracza[atakujacy]+=(1+get_pcvar_num(p_exp_vip_extra_monets))
  1866. else
  1867. monety_gracza[atakujacy]++
  1868.  
  1869. SprawdzExp(atakujacy)
  1870. ZapiszExp(atakujacy)
  1871.  
  1872. if(punkty_gracza[obronca] > 0 || ultra_punkty_gracza[obronca] > 0)
  1873. MenuWybor(obronca)
  1874.  
  1875. ZapiszExp(obronca)
  1876. }
  1877. return PLUGIN_CONTINUE
  1878.  
  1879. }
  1880.  
  1881. ///////////////////////////////////////////////////////
  1882.  
  1883. public ZapiszExp(id)
  1884. {
  1885. if(doswiadczenie_gracza[id] <= 250)
  1886. return;
  1887.  
  1888. get_user_name(id, nazwa_gracza, 32)
  1889. new dane[256]
  1890.  
  1891. plik = nvault_open("ExpMod")
  1892. formatex(dane, 255, "%i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", doswiadczenie_gracza[id], poziom_gracza[id], punkty_gracza[id],
  1893. ultra_punkty_gracza[id], zycie_gracza[id], nowe_zycie_gracza[id], niewidzialnosc_gracza[id], nowa_niewidzialnosc_gracza[id], obrazenia_gracza[id],
  1894. nowe_obrazenia_gracza[id], szybkosc_gracza[id], floatround(nowa_szybkosc_gracza[id]), grawitacja_gracza[id], floatround(nowa_grawitacja_gracza[id]),
  1895. kasa_gracza[id], nowa_kasa_gracza[id], skoki_gracza[id], nowe_skoki_gracza[id], longjump_gracza[id], nowy_longujmp_gracza[id], longjump_s_czas[id], monety_gracza[id])
  1896.  
  1897. nvault_set(plik, nazwa_gracza, dane)
  1898.  
  1899. nvault_close(plik)
  1900. }
  1901.  
  1902.  
  1903. ///////////////////////////////////////////////////////
  1904.  
  1905. public WczytajExp(id)
  1906. {
  1907.  
  1908. get_user_name(id, nazwa_gracza, 32)
  1909. new dane[256]
  1910.  
  1911. plik = nvault_open("ExpMod")
  1912. if(nvault_get(plik, nazwa_gracza, dane, 255)) {
  1913. if(!is_user_bot(id))
  1914. nvault_touch(plik, nazwa_gracza)
  1915. ;
  1916. new dg[16], pg[16], pkt[16], upkt[16], hp[16], nhp[16], ng[16],
  1917. nng[16], og[16], nog[16], sg[16], nsg[16], gg[16], ngg[16], kg[16],
  1918. nkg[16], skokig[16], noweskg[16], lg[16], nlg[16], lgsc[16], mg[16]
  1919.  
  1920. parse(dane, dg, 15, pg, 15, pkt, 15, upkt, 15, hp, 15, nhp, 15, ng, 15, nng, 15, og, 15,
  1921. nog, 15, sg, 15, nsg, 15, gg, 15, ngg, 15, kg , 15, nkg, 15, skokig, 15, noweskg, 15, lg,
  1922. 15, nlg, 15, lgsc, 15, mg, 15)
  1923.  
  1924. doswiadczenie_gracza[id] = str_to_num(dg)
  1925. poziom_gracza[id] = str_to_num(pg)
  1926.  
  1927. punkty_gracza[id] = str_to_num(pkt)
  1928. ultra_punkty_gracza[id] = str_to_num(upkt)
  1929.  
  1930. monety_gracza[id] = str_to_num(mg)
  1931.  
  1932. zycie_gracza[id] = str_to_num(hp)
  1933. nowe_zycie_gracza[id] = str_to_num(nhp)
  1934.  
  1935. niewidzialnosc_gracza[id] = str_to_num(ng)
  1936. nowa_niewidzialnosc_gracza[id] = str_to_num(nng)
  1937.  
  1938. obrazenia_gracza[id] = str_to_num(og)
  1939. nowe_obrazenia_gracza[id] = str_to_num(nog)
  1940.  
  1941. szybkosc_gracza[id] = str_to_num(sg)
  1942. nowa_szybkosc_gracza[id] = float(str_to_num(nsg))
  1943.  
  1944. grawitacja_gracza[id] = str_to_num(gg)
  1945. nowa_grawitacja_gracza[id] = float(str_to_num(ngg))
  1946.  
  1947. kasa_gracza[id] = str_to_num(kg)
  1948. nowa_kasa_gracza[id] = str_to_num(nkg)
  1949.  
  1950. skoki_gracza[id] = str_to_num(skokig)
  1951. nowe_skoki_gracza[id] = str_to_num(noweskg)
  1952.  
  1953. longjump_gracza[id] = str_to_num(lg)
  1954. nowy_longujmp_gracza[id] = str_to_num(nlg)
  1955. longjump_s_czas[id] = str_to_num(lgsc)
  1956. }
  1957. nvault_close(plik)
  1958. }
  1959.  
  1960. ///////////////////////////////////////////////////////
  1961.  
  1962. public SprawdzExp(id)
  1963. {
  1964. if(!is_user_connected(id))
  1965. return PLUGIN_CONTINUE
  1966. while(doswiadczenie_gracza[id] >= POZIOM[poziom_gracza[id]+1])
  1967. {
  1968. punkty_gracza[id]+=PUNKTY_ZA_LEVEL
  1969. poziom_gracza[id]++
  1970. if(get_user_flags(id) & VIP_FLAG)
  1971. monety_gracza[id]+= (1+get_pcvar_num(p_exp_vip_extra_monets))
  1972. else
  1973. monety_gracza[id]++
  1974.  
  1975. switch(random_num(1,2))
  1976. {
  1977. case 1: client_cmd(id, "spk %s", level_up);
  1978. case 2: client_cmd(id, "spk %s", level_up2);
  1979. }
  1980.  
  1981. set_hudmessage(255, 255, 255, -1.0, 0.4, 0, 6.0, 2.0)
  1982. ShowSyncHudMsg(id, Message2, "%L", id, "MSG_LEVEL_UP", get_user_level(id))
  1983.  
  1984. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  1985. {
  1986. ColorChat(id, GREEN, "%s^x01 %L.", prefix, id, "MSG_LEVEL_UP", get_user_level(id))
  1987. }
  1988.  
  1989. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  1990. {
  1991. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  1992. {
  1993. switch(random_num(1,2))
  1994. {
  1995. case 1: client_cmd(id, "spk %s", komunikat1)
  1996. case 2: client_cmd(id, "spk %s", komunikat2)
  1997. }
  1998. }
  1999. tutorMake(id, TUTOR_YELLOW, 5.0, "%L", id, "MSG_LEVEL_UP", poziom_gracza[id])
  2000. }
  2001. if((get_user_level(id) % 10) == 0)
  2002. ultra_punkty_gracza[id]++
  2003.  
  2004. get_user_name(id, nazwa_gracza, 32)
  2005. if((poziom_gracza[id] % 50) == 0)
  2006. {
  2007. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  2008. ColorChat(0, GREEN, "%s^x01 %L", prefix, LANG_SERVER, "MSG_HIGH_LEVEL_EARNED", nazwa_gracza, poziom_gracza[id])
  2009.  
  2010. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  2011. {
  2012. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  2013. {
  2014. switch(random_num(1,2))
  2015. {
  2016. case 1: client_cmd(id, "spk %s", komunikat1)
  2017. case 2: client_cmd(id, "spk %s", komunikat2)
  2018. }
  2019. }
  2020. tutorMake(0, TUTOR_YELLOW, 5.0, "%L", LANG_SERVER, "MSG_HIGH_LEVEL_EARNED", nazwa_gracza, poziom_gracza[id])
  2021. }
  2022. }
  2023.  
  2024. if(is_user_bot(id) && get_pcvar_num(p_exp_boty) == 1)
  2025. client_cmd(id, "say /przydziel")
  2026.  
  2027. MenuWybor(id)
  2028. ZapiszExp(id)
  2029. }
  2030. return PLUGIN_CONTINUE
  2031. }
  2032.  
  2033. ///////////////////////////////////////////////////////
  2034.  
  2035. public Pokaz(id)
  2036. {
  2037. id -= TASK_HUD_INFO
  2038. set_task(3.0, "Pokaz", id+TASK_HUD_INFO);
  2039.  
  2040. if(!is_user_alive(id) && is_user_connected(id) && !is_user_bot(id))
  2041. {
  2042. new cel = entity_get_int(id, EV_INT_iuser2)
  2043.  
  2044. if(!cel)
  2045. return PLUGIN_CONTINUE
  2046.  
  2047. new ileMa2 = doswiadczenie_gracza[cel]
  2048. new ilePotrzeba2 = POZIOM[poziom_gracza[cel]+1]
  2049. new ilePotrzebaBylo2
  2050. if(poziom_gracza[cel] > 0)
  2051. ilePotrzebaBylo2 = get_user_previouslevelexp(cel)
  2052. else if(poziom_gracza[cel] <= 0)
  2053. ilePotrzebaBylo2 = 0
  2054.  
  2055. new Float:dos_cel = 0.0
  2056.  
  2057. dos_cel = (float((ileMa2 - ilePotrzebaBylo2)) / float((ilePotrzeba2 - ilePotrzebaBylo2))) * 100.0;
  2058.  
  2059. set_hudmessage(255, 255, 255, 0.56, 0.62, 0, 6.0, 3.1)
  2060. ShowSyncHudMsg(id, Message4, "%L : %i / %i | %0.1f%%^n%L : %i ^n%L : %i", id, "EXP", doswiadczenie_gracza[cel], POZIOM[poziom_gracza[cel]+1], dos_cel, id, "LEVEL", poziom_gracza[cel], id, "HEALTH", get_user_health(cel))
  2061.  
  2062. if(get_pcvar_num(p_exp_hud_level) == 3 || get_pcvar_num(p_exp_hud_level) == 2)
  2063. {
  2064. set_hudmessage(127, 40, 255, 0.70, 0.81, 0, 6.0, 3.1)
  2065. ShowSyncHudMsg(id, Message3, "^n%d -> %d <- %d^n", poziom_gracza[cel]-1, poziom_gracza[cel], poziom_gracza[cel]+1)
  2066. }
  2067. }
  2068. else if(is_user_alive(id) && is_user_connected(id) && !is_user_bot(id))
  2069. {
  2070. new ileMa3 = doswiadczenie_gracza[id]
  2071. new ilePotrzeba3 = POZIOM[poziom_gracza[id]+1]
  2072. new ilePotrzebaBylo3
  2073.  
  2074. if(poziom_gracza[id] > 0)
  2075. ilePotrzebaBylo3 = POZIOM[poziom_gracza[id]-1]
  2076. else if(poziom_gracza[id] <= 0)
  2077. ilePotrzebaBylo3 = 0
  2078.  
  2079. new Float:dos = 0.0
  2080.  
  2081. dos = (float((ileMa3 - ilePotrzebaBylo3)) / float((ilePotrzeba3 - ilePotrzebaBylo3))) * 100.0;
  2082.  
  2083. set_hudmessage(255, 255, 56, 0.0, 0.18, 0, 6.0, 3.1)
  2084. ShowSyncHudMsg(id, Message4, "[%L : %i / %i | %0.1f%%]^n[%L : %i]^n[%L : %i]^n[%L : %i]", id, "EXP", doswiadczenie_gracza[id], POZIOM[poziom_gracza[id]+1], dos, id, "LEVEL", poziom_gracza[id], id, "HEALTH", get_user_health(id), id, "MONETS", monety_gracza[id])
  2085.  
  2086. if(get_pcvar_num(p_exp_hud_level) == 3 || get_pcvar_num(p_exp_hud_level) == 1)
  2087. {
  2088. set_hudmessage(127, 40, 255, -1.0, 0.01, 0, 6.0, 3.1)
  2089. ShowSyncHudMsg(id, Message3, "^n%d -> %d <- %d^n", poziom_gracza[id]-1, poziom_gracza[id], poziom_gracza[id]+1)
  2090. }
  2091. }
  2092. return PLUGIN_CONTINUE
  2093. }
  2094.  
  2095. public ZaapiszExp()
  2096. {
  2097. for(new i = 1 ; i < 33; i++)
  2098. {
  2099. if(!is_user_connected(i) || is_user_hltv(i))
  2100. continue;
  2101. ZapiszExp(i)
  2102. }
  2103.  
  2104. }
  2105.  
  2106. ///////////////////////////////////////////////////////
  2107.  
  2108. public bomb_planted(podkladajacy)
  2109. {
  2110. if(!is_user_alive(podkladajacy) || !is_user_connected(podkladajacy) || get_playersnum() < get_pcvar_num(p_exp_of_players))
  2111. return PLUGIN_CONTINUE
  2112.  
  2113. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  2114. ColorChat(podkladajacy, GREEN, "%s^x01 %L", prefix, podkladajacy, "MSG_BOMB_PLANTED", get_pcvar_num(p_exp_podlozenie_paki))
  2115.  
  2116. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  2117. tutorMake(podkladajacy, TUTOR_GREEN, 5.0, "%L", podkladajacy, "MSG_BOMB_PLANTED", get_pcvar_num(p_exp_podlozenie_paki))
  2118.  
  2119. if(get_user_flags(podkladajacy) & VIP_FLAG)
  2120. doswiadczenie_gracza[podkladajacy]+=get_pcvar_num(p_exp_podlozenie_paki)+get_pcvar_num(p_exp_vip_extra_exp)
  2121. else
  2122. doswiadczenie_gracza[podkladajacy]+=get_pcvar_num(p_exp_podlozenie_paki)
  2123.  
  2124.  
  2125. return PLUGIN_CONTINUE
  2126. }
  2127.  
  2128. ///////////////////////////////////////////////////////
  2129.  
  2130. public bomb_defused(rozbrajajacy)
  2131. {
  2132. if(!is_user_alive(rozbrajajacy) || !is_user_connected(rozbrajajacy) || get_playersnum() < get_pcvar_num(p_exp_of_players))
  2133. return PLUGIN_CONTINUE
  2134.  
  2135. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  2136. ColorChat(rozbrajajacy, GREEN, "%s^x01 %L", prefix, rozbrajajacy, "MSG_DEFUSED_BOMB", get_pcvar_num(p_exp_rozbrojenie_paki))
  2137.  
  2138. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  2139. {
  2140. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  2141. {
  2142. switch(random_num(1,2))
  2143. {
  2144. case 1: client_cmd(rozbrajajacy, "spk %s", komunikat1)
  2145. case 2: client_cmd(rozbrajajacy, "spk %s", komunikat2)
  2146. }
  2147. }
  2148. tutorMake(rozbrajajacy, TUTOR_GREEN, 5.0, "%L", rozbrajajacy, "MSG_DEFUSED_BOMB", get_pcvar_num(p_exp_rozbrojenie_paki))
  2149. }
  2150. if(get_user_flags(rozbrajajacy) & VIP_FLAG)
  2151. doswiadczenie_gracza[rozbrajajacy]+=get_pcvar_num(p_exp_rozbrojenie_paki)+get_pcvar_num(p_exp_vip_extra_exp)
  2152. else
  2153. doswiadczenie_gracza[rozbrajajacy]+=get_pcvar_num(p_exp_rozbrojenie_paki)
  2154. return PLUGIN_CONTINUE
  2155. }
  2156. public UratowanieHosta()
  2157. {
  2158.  
  2159. new id = get_loguser_index()
  2160.  
  2161. if(get_pcvar_num(p_exp_infostyle) == 2 || get_pcvar_num(p_exp_infostyle) == 3)
  2162. ColorChat(id, GREEN, "%s^x01 %L", prefix, id, "MSG_RESCUED_HOSTAGE", get_pcvar_num(p_exp_uratowanie_hosta))
  2163.  
  2164. if(get_user_flags(id) & VIP_FLAG)
  2165. set_user_exp(id, get_user_exp(id)+get_pcvar_num(p_exp_uratowanie_hosta)+get_pcvar_num(p_exp_vip_extra_exp))
  2166. else
  2167. set_user_exp(id, get_user_exp(id)+get_pcvar_num(p_exp_uratowanie_hosta) )
  2168.  
  2169. if(get_pcvar_num(p_exp_infostyle) == 1 || get_pcvar_num(p_exp_infostyle) == 3)
  2170. {
  2171. if(get_pcvar_num(p_exp_tutor_sound) == 1)
  2172. {
  2173. switch(random_num(1,2))
  2174. {
  2175. case 1: client_cmd(id, "spk %s", komunikat1)
  2176. case 2: client_cmd(id, "spk %s", komunikat2)
  2177. }
  2178. }
  2179. tutorMake(id, TUTOR_GREEN, 5.0, "%L", id, "MSG_RESCUED_HOSTAGE", get_pcvar_num(p_exp_uratowanie_hosta))
  2180. }
  2181.  
  2182. }
  2183. ///////////////////////////////////////////////////////
  2184.  
  2185. public messageScoreAttrib(iMsgID, iDest, iReceiver)
  2186. {
  2187. new iPlayer = get_msg_arg_int(1);
  2188.  
  2189. if(is_user_connected(iPlayer) && (get_user_flags(iPlayer) & VIP_FLAG))
  2190. set_msg_arg_int(2, ARG_BYTE, is_user_alive(iPlayer) ? SCOREATTRIB_VIP : SCOREATTRIB_DEAD);
  2191. }
  2192.  
  2193. ///////////////////////////////////////////////////////
  2194. ///////////////////////NATYWY//////////////////////////
  2195. ///////////////////////////////////////////////////////
  2196.  
  2197. public get_user_level(index)
  2198. {
  2199. if(poziom_gracza[index]-1 < 0)
  2200. return 0
  2201.  
  2202. return poziom_gracza[index]
  2203. }
  2204. public get_levelexp(level)
  2205. return POZIOM[level]
  2206. public get_user_exp(index)
  2207. return doswiadczenie_gracza[index]
  2208.  
  2209. public get_user_nextlevelexp(index)
  2210. return POZIOM[poziom_gracza[index]+1]
  2211.  
  2212. public get_user_previouslevelexp(index)
  2213. {
  2214. if(poziom_gracza[index]-1 < 0)
  2215. return 0
  2216. return POZIOM[poziom_gracza[index]-1]
  2217. }
  2218.  
  2219. public set_user_level(index, level)
  2220. poziom_gracza[index] = level
  2221.  
  2222.  
  2223. public set_user_exp(index, exp)
  2224. doswiadczenie_gracza[index] = exp
  2225.  
  2226. ///////////////////////////////////////////////////////
  2227.  
  2228. public set_user_invisible(index, value)
  2229. set_user_rendering(index, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, value)
  2230.  
  2231. public get_user_monets(index)
  2232. return monety_gracza[index]
  2233.  
  2234. public get_user_new_health(index)
  2235. return nowe_zycie_gracza[index]
  2236.  
  2237. //public get_user_new_speed(index)
  2238. //return nowa_szybkosc_gracza[index]
  2239.  
  2240. //public get_user_new_gravity(index)
  2241. //return nowa_grawitacja_gracza[index]
  2242.  
  2243. //public get_user_new_cash(index)
  2244. //return nowa_kasa_gracza[index]
  2245.  
  2246. public set_user_monets(index, ammount)
  2247. return monety_gracza[index] = ammount
  2248.  
  2249. stock get_loguser_index()
  2250. {
  2251. new loguser[80], name[32]
  2252. read_logargv(0, loguser, 79)
  2253. parse_loguser(loguser, name, 31)
  2254.  
  2255. return get_user_index(name)
  2256. }
  2257.  
  2258. public is_user_vip(index)
  2259. {
  2260. if(get_user_flags(index) & VIP_FLAG)
  2261. return 1;
  2262.  
  2263. return 0
  2264. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement