HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2.   Fordította: BBk
  3. */
  4.  
  5. native hnsxp_get_user_xp(client);
  6.  
  7. native hnsxp_set_user_xp(client, xp);
  8.  
  9. stock hnsxp_add_user_xp(client, xp)
  10. {
  11. return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) + xp);
  12. }
  13.  
  14. stock hnsxp_sub_user_xp(client, xp)
  15. {
  16. return hnsxp_set_user_xp(client, hnsxp_get_user_xp(client) - xp);
  17. }
  18.  
  19. #include <amxmodx>
  20. #include <amxmisc>
  21. #include <hamsandwich>
  22. #include <fun>
  23. #include <cstrike>
  24. #include <colorchat>
  25.  
  26. #define PLUGIN "HideNSeek VIP Mod"
  27. #define AUTHOR "HBxander"
  28. #define VERSION "1.4"
  29.  
  30. new vipinfo[] = "vip_info.txt";
  31. new vipprices[] = "vip_price.txt";
  32.  
  33. static const COLOR[] = "^x04"
  34.  
  35. new enable_Weapons;
  36. new enable_Items;
  37. new enable_Grenades;
  38. new g_iMoney[33];
  39.  
  40. new clantac;
  41. new awp_cost;
  42. new deagle_cost;
  43. new shotgun_cost;
  44. new fiveseven_cost;
  45. new hegren_cost;
  46. new respawn_cost;
  47. new colt_cost;
  48. new xp_amount;
  49. new xp_cost;
  50. new hp_amount;
  51. new hp_cost;
  52. new scout_cost;
  53. new frost_cost;
  54.  
  55. new bought_respawn;
  56. new bought_xp;
  57. new bought_hp;
  58. new gMaxPlayers;
  59. new bool:gbConnected[33];
  60. new bool:got_access[33]
  61.  
  62. public plugin_init()
  63. {
  64. register_plugin(PLUGIN,VERSION,AUTHOR)
  65. register_clcmd("say /vip", "show_VIPHowTo");
  66. register_clcmd("say /vips", "print_vips");
  67. register_clcmd("say /vs", "vip_shop");
  68. register_clcmd("say /vipshop", "vip_shop");
  69. register_clcmd("say /vshop", "vip_shop");
  70. register_clcmd("say_team /vs", "vip_shop");
  71. register_clcmd("say_team /vipshop", "vip_shop");
  72. register_clcmd("say_team /vshop", "vip_shop");
  73.  
  74. //enable stuff
  75. enable_Weapons = register_cvar("vip_weapons", "1");
  76. enable_Items = register_cvar("vip_items", "1");
  77. enable_Grenades = register_cvar("vip_grenades", "1");
  78. //weapons price
  79. awp_cost = register_cvar("vip_awpcost", "16000");
  80. deagle_cost = register_cvar("vip_dglcost", "12000");
  81. shotgun_cost = register_cvar("vip_m3cost", "12000");
  82. fiveseven_cost = register_cvar("vip_fivesevencost", "8000");
  83. colt_cost = register_cvar("vip_coltcost", "8000");
  84. scout_cost = register_cvar("vip_scoutcost", "3000");
  85. //grenades price
  86. hegren_cost = register_cvar("vip_hegrencost", "8000");
  87. frost_cost = register_cvar("vip_frostcost", "12000");
  88. //items price
  89. respawn_cost = register_cvar("vip_respawncost", "10000");
  90. hp_cost = register_cvar("vip_hpcost", "6000");
  91. xp_cost = register_cvar("vip_xpcost", "6000");
  92. //item amount
  93. xp_amount = register_cvar("vip_xpamount", "10");
  94. hp_amount = register_cvar("vip_hpamount", "25");
  95. //clantac
  96. clantac = register_cvar("vip_clantac", "YourClanTac");
  97.  
  98. gMaxPlayers = get_maxplayers();
  99. }
  100.  
  101. public vip_shop(id)
  102. {
  103. new MainMenu = menu_create("\rVIP Mod^n^nFomenu", "MainMenu_Handle");
  104.  
  105. menu_additem(MainMenu, "\wInfo", "\r1", 0);
  106. menu_additem(MainMenu, "\wArak", "\r2", 0);
  107. menu_addblank(MainMenu, 0);
  108. if ( get_pcvar_num(enable_Weapons) == 1 )
  109. {
  110. menu_additem(MainMenu, "\wFegyver Menu", "\r3", 0);
  111. }
  112. if ( get_pcvar_num(enable_Items) == 1 )
  113. {
  114. menu_additem(MainMenu, "\wEszkoz Menu", "\r4", 0);
  115. }
  116. if ( get_pcvar_num(enable_Grenades) == 1 )
  117. {
  118. menu_additem(MainMenu, "\wGranat Menu", "\r5", 0);
  119. }
  120. menu_setprop(MainMenu, MPROP_EXIT, MEXIT_ALL);
  121. if ( got_access[id] )
  122. {
  123. menu_display(id, MainMenu, 0);
  124. }
  125. }
  126.  
  127. public MainMenu_Handle(id, menu, item)
  128. {
  129. if (item == MENU_EXIT)
  130. {
  131. menu_destroy(menu);
  132. return PLUGIN_HANDLED;
  133. }
  134.  
  135. new data[6], iName[64];
  136. new access, callback;
  137.  
  138. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  139. new key = str_to_num(data);
  140.  
  141. switch(key)
  142. {
  143. case 1:
  144. {
  145. show_motd(id, vipinfo, "VIP Info");
  146. }
  147. case 2:
  148. {
  149. show_motd(id, vipprices, "VIP Arak");
  150. }
  151. case 3:
  152. {
  153. weapon_Menu(id);
  154. }
  155. case 4:
  156. {
  157. item_Menu(id);
  158. }
  159. case 5:
  160. {
  161. grenades_Menu(id);
  162. }
  163. }
  164. return PLUGIN_CONTINUE;
  165. }
  166. public grenades_Menu(id)
  167. {
  168. new buy_hegren[60];
  169. new buy_frost[60];
  170.  
  171. formatex(buy_hegren, sizeof(buy_hegren) - 1, "\wHeGranat \r[Ara: \w1\r] \r[$\y%i\r]", get_pcvar_num(hegren_cost));
  172. formatex(buy_frost, sizeof(buy_frost) - 1, "\wFagyasztoGranat \r[Ara: \w1\r] \r[$\y%i\r]", get_pcvar_num(frost_cost));
  173.  
  174. new gren_Menu = menu_create("\rVIP Mod^n^nEszkoz Menu", "ItemMenu_Handle");
  175.  
  176. menu_additem(gren_Menu, buy_hegren, "\r1", 0);
  177. if ( cs_get_user_team(id) == CS_TEAM_T )
  178. {
  179. menu_additem(gren_Menu, buy_frost, "\r2", 0);
  180. }
  181. menu_setprop(gren_Menu, MPROP_EXIT, MEXIT_ALL);
  182. {
  183. menu_display(id, gren_Menu, 0);
  184. }
  185. }
  186.  
  187. public GrenadesMenu_Handle(id, menu, item)
  188. {
  189. if (item == MENU_EXIT)
  190. {
  191. menu_destroy(menu);
  192. return PLUGIN_HANDLED;
  193. }
  194.  
  195. new data[6], iName[64];
  196. new access, callback;
  197.  
  198. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  199. new key = str_to_num(data);
  200.  
  201. switch(key)
  202. {
  203. case 1:
  204. {
  205. if ( cs_get_user_money(id) < get_pcvar_num(hegren_cost) )
  206. {
  207. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd a`x04 He Granatot^x01!", clantac);
  208. return PLUGIN_HANDLED;
  209. }
  210.  
  211. if ( !is_user_alive(id) )
  212. {
  213. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 You need to be^x04 alive^x01!", clantac);
  214. return PLUGIN_HANDLED;
  215. }
  216.  
  217. if ( user_has_weapon(id, CSW_HEGRENADE) )
  218. {
  219. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van neked egy^x04 He Granat^x01!", clantac);
  220. return PLUGIN_HANDLED;
  221. }
  222. new name[32];
  223. get_user_name(id, name, 32);
  224. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(hegren_cost));
  225. cs_set_weapon_ammo( give_item(id, "weapon_hegren"), 0);
  226. cs_set_user_bpammo(id, CSW_HEGRENADE, (cs_get_user_bpammo(id, CSW_HEGRENADE) + 1));
  227. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 He Granatot^x01 [$%i]", clantac, name, get_pcvar_num(hegren_cost));
  228. }
  229. case 2:
  230. {
  231. if ( cs_get_user_money(id) < get_pcvar_num(frost_cost) )
  232. {
  233. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd a`x04 Fagyaszto Granatot^x01!", clantac);
  234. return PLUGIN_HANDLED;
  235. }
  236.  
  237. if ( !is_user_alive(id) )
  238. {
  239. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 You need to be ^x04alive^x01!", clantac);
  240. return PLUGIN_HANDLED;
  241. }
  242.  
  243. if ( user_has_weapon(id, CSW_SMOKEGRENADE) )
  244. {
  245. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van neked egy^x04 Fagyaszto Granat^x01!", clantac);
  246. return PLUGIN_HANDLED;
  247. }
  248. new name[32];
  249. get_user_name(id, name, 32);
  250. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(frost_cost));
  251. cs_set_weapon_ammo( give_item(id, "weapon_sgren"), 0);
  252. cs_set_user_bpammo(id, CSW_SMOKEGRENADE, (cs_get_user_bpammo(id, CSW_SMOKEGRENADE) + 1));
  253. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 Fagyaszto Granatot^x01 [$%i]", clantac, name, get_pcvar_num(frost_cost));
  254. }
  255. }
  256. return PLUGIN_CONTINUE;
  257. }
  258. public TaskRespawn(id)
  259. {
  260. if ( cs_get_user_money(id) < get_pcvar_num(respawn_cost) )
  261. {
  262. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  263. return PLUGIN_HANDLED;
  264. }
  265. if ( bought_respawn == 1 )
  266. {
  267. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar vettel ujraeledest ebben a korben!", clantac);
  268. return PLUGIN_HANDLED;
  269. }
  270. if ( is_user_alive(id) )
  271. {
  272. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nem vehetsz ujraeledest, amig eletben vagy!", clantac);
  273. return PLUGIN_HANDLED;
  274. }
  275. new name[32];
  276. get_user_name(id, name, 32);
  277. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(respawn_cost) );
  278. ExecuteHamB(Ham_CS_RoundRespawn, id);
  279. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' ujraeledest vasarolt!", clantac, name);
  280. bought_respawn = 1;
  281.  
  282. return PLUGIN_HANDLED;
  283. }
  284.  
  285. public weapon_Menu(id)
  286. {
  287. new buy_awp[60];
  288. new buy_deagle[60];
  289. new buy_shotgun[60];
  290. new buy_colt[60];
  291. new buy_fiveseven[60];
  292. new buy_scout[60];
  293.  
  294. formatex(buy_awp, sizeof(buy_awp) - 1, "\wAWP \r[Tolteny: \w1\r] \r[$\y%i\r]", get_pcvar_num(awp_cost));
  295. formatex(buy_deagle, sizeof(buy_deagle) - 1, "\wDeagle \r[Tolteny: \w1\r] \r[$\y%i\r]", get_pcvar_num(deagle_cost));
  296. formatex(buy_shotgun, sizeof(buy_shotgun) - 1, "\wShotGun \r[Tolteny: \w1\r] \r[$\y%i\r]", get_pcvar_num(shotgun_cost));
  297. formatex(buy_colt, sizeof(buy_colt) - 1, "\wColt \r[Tolteny: \w1\r] \r[$\y%i\r]", get_pcvar_num(colt_cost));
  298. formatex(buy_fiveseven, sizeof(buy_fiveseven) - 1, "\wFiveSeven \r[Tolteny: \w2\r] \r[$\y%i\r]", get_pcvar_num(fiveseven_cost));
  299. formatex(buy_scout, sizeof(buy_scout) - 1, "\wScout \r[Tolteny: \w0\r] \r[$\y%i\r]", get_pcvar_num(scout_cost));
  300. new wep_Menu = menu_create("\rVIP Mod^n^nFegyver Menu", "wepMenu_Handle");
  301.  
  302. menu_additem(wep_Menu, buy_awp, "\r1", 0);
  303. menu_additem(wep_Menu, buy_deagle, "\r2", 0);
  304. menu_additem(wep_Menu, buy_shotgun, "\r3", 0);
  305. menu_additem(wep_Menu, buy_colt, "\r4", 0);
  306. menu_additem(wep_Menu, buy_fiveseven, "\r5", 0);
  307. menu_additem(wep_Menu, buy_scout, "\r6", 0);
  308. menu_setprop(wep_Menu, MPROP_EXIT, MEXIT_ALL);
  309. {
  310. menu_display(id, wep_Menu, 0);
  311. }
  312. }
  313.  
  314. public wepMenu_Handle(id, menu, item)
  315. {
  316. if (item == MENU_EXIT)
  317. {
  318. menu_destroy(menu);
  319. return PLUGIN_HANDLED;
  320. }
  321.  
  322. new data[6], iName[64];
  323. new access, callback;
  324.  
  325. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  326. new key = str_to_num(data);
  327.  
  328. switch(key)
  329. {
  330. case 1:
  331. {
  332. if ( cs_get_user_money(id) < get_pcvar_num(awp_cost) )
  333. {
  334. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  335. return PLUGIN_HANDLED;
  336. }
  337.  
  338. if ( !is_user_alive(id) )
  339. {
  340. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  341. return PLUGIN_HANDLED;
  342. }
  343.  
  344. if ( user_has_weapon(id, CSW_AWP) )
  345. {
  346. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  347. return PLUGIN_HANDLED;
  348. }
  349.  
  350. new name[32];
  351. get_user_name(id, name, 32)
  352. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(awp_cost) );
  353. cs_set_weapon_ammo( give_item(id, "weapon_awp"), 1);
  354. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 AWP-t^x01 [$%i]", clantac, name, get_pcvar_num(awp_cost));
  355.  
  356. }
  357. case 2:
  358. {
  359. if ( cs_get_user_money(id) < get_pcvar_num(deagle_cost) )
  360. {
  361. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  362. return PLUGIN_HANDLED;
  363. }
  364.  
  365. if ( !is_user_alive(id) )
  366. {
  367. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  368. return PLUGIN_HANDLED;
  369. }
  370.  
  371. if ( user_has_weapon(id, CSW_DEAGLE) )
  372. {
  373. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  374. return PLUGIN_HANDLED;
  375. }
  376.  
  377. new name[32];
  378. get_user_name(id, name, 32)
  379. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(deagle_cost));
  380. cs_set_weapon_ammo( give_item(id, "weapon_deagle"), 1);
  381. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 Deagle-t^x01 [$%i]", clantac, name, get_pcvar_num(deagle_cost));
  382. }
  383. case 3:
  384. {
  385. if ( cs_get_user_money(id) < get_pcvar_num(shotgun_cost) )
  386. {
  387. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  388. return PLUGIN_HANDLED;
  389. }
  390.  
  391. if ( !is_user_alive(id) )
  392. {
  393. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  394. return PLUGIN_HANDLED;
  395. }
  396.  
  397. if ( user_has_weapon(id, CSW_M3) )
  398. {
  399. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  400. return PLUGIN_HANDLED;
  401. }
  402. new name[32];
  403. get_user_name(id, name, 32);
  404. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(shotgun_cost));
  405. cs_set_weapon_ammo( give_item(id, "weapon_shotgun"), 1);
  406. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 ShotGun-t^x01 [$%i]", clantac, name, get_pcvar_num(shotgun_cost));
  407. }
  408. case 4:
  409. {
  410. if ( cs_get_user_money(id) < get_pcvar_num(colt_cost) )
  411. {
  412. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  413. return PLUGIN_HANDLED;
  414. }
  415.  
  416. if ( !is_user_alive(id) )
  417. {
  418. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  419. return PLUGIN_HANDLED;
  420. }
  421.  
  422. if ( user_has_weapon(id, CSW_M4A1) )
  423. {
  424. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  425. return PLUGIN_HANDLED;
  426. }
  427. new name[32];
  428. get_user_name(id, name, 32);
  429. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(colt_cost));
  430. cs_set_weapon_ammo( give_item(id, "weapon_m4a1"), 1);
  431. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 Colt-ot^x01 [$%i]", clantac, name, get_pcvar_num(colt_cost));
  432. }
  433. case 5:
  434. {
  435. if ( cs_get_user_money(id) < get_pcvar_num(fiveseven_cost) )
  436. {
  437. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  438. return PLUGIN_HANDLED;
  439. }
  440.  
  441. if ( !is_user_alive(id) )
  442. {
  443. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  444. return PLUGIN_HANDLED;
  445. }
  446.  
  447. if ( user_has_weapon(id, CSW_FIVESEVEN) )
  448. {
  449. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  450. return PLUGIN_HANDLED;
  451. }
  452. new name[32];
  453. get_user_name(id, name, 32);
  454. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(fiveseven_cost));
  455. cs_set_weapon_ammo( give_item(id, "weapon_fiveseven"), 2 );
  456. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 FiveSeven-t^x01 [$%i]", clantac, name, get_pcvar_num(fiveseven_cost));
  457. }
  458. case 6:
  459. {
  460. if ( cs_get_user_money(id) < get_pcvar_num(scout_cost) )
  461. {
  462. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  463. return PLUGIN_HANDLED;
  464. }
  465.  
  466. if ( !is_user_alive(id) )
  467. {
  468. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Eletben kell, hogy legyel!", clantac);
  469. return PLUGIN_HANDLED;
  470. }
  471.  
  472. if ( user_has_weapon(id, CSW_SCOUT) )
  473. {
  474. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar van ilyen fegyvered!", clantac);
  475. return PLUGIN_HANDLED;
  476. }
  477. new name[32];
  478. get_user_name(id, name, 32);
  479. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(scout_cost));
  480. cs_set_weapon_ammo( give_item(id, "weapon_scout"), 0);
  481. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett egy^x04 Scout-ot^x01 [$%i]", clantac, name, get_pcvar_num(scout_cost));
  482. }
  483. }
  484. return PLUGIN_CONTINUE;
  485. }
  486.  
  487. public item_Menu(id)
  488. {
  489. new buy_respawn[60];
  490. new buy_xp[60];
  491. new buy_hp[60];
  492.  
  493. formatex(buy_respawn, sizeof(buy_respawn) - 1, "\wUjraeledes \r[$\y%i\r]", get_pcvar_num(respawn_cost));
  494. formatex(buy_xp, sizeof(buy_xp) - 1, "\w%i XP \y[$\y%i\r]", get_pcvar_num(xp_amount), get_pcvar_num(xp_cost));
  495. formatex(buy_hp, sizeof(buy_hp) - 1, "\w%i HP \r[$\y%i\r]", get_pcvar_num(shotgun_cost));
  496.  
  497. new ite_Menu = menu_create("\rVIP Mod^n^nEszkoz Menu", "ItemMenu_Handle");
  498.  
  499. menu_additem(ite_Menu, buy_respawn, "\r1", 0);
  500. menu_additem(ite_Menu, buy_xp, "\r2", 0);
  501. menu_additem(ite_Menu, buy_hp, "\r3", 0);
  502. menu_setprop(ite_Menu, MPROP_EXIT, MEXIT_ALL);
  503. {
  504. menu_display(id, ite_Menu, 0);
  505. }
  506. }
  507.  
  508. public ItemMenu_Handle(id, menu, item)
  509. {
  510. if (item == MENU_EXIT)
  511. {
  512. menu_destroy(menu);
  513. return PLUGIN_HANDLED;
  514. }
  515.  
  516. new data[6], iName[64];
  517. new access, callback;
  518.  
  519. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  520. new key = str_to_num(data);
  521.  
  522. switch(key)
  523. {
  524. case 1:
  525. {
  526. set_task(0.2, "TaskRespawn", id);
  527. }
  528. case 2:
  529. {
  530. if ( cs_get_user_money(id) < get_pcvar_num(xp_cost) )
  531. {
  532. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  533. return PLUGIN_HANDLED;
  534. }
  535. if ( bought_xp == 1 )
  536. {
  537. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar vettel^x04 XP-t^x01 ebben a korben!", clantac);
  538. return PLUGIN_HANDLED;
  539. }
  540. new name[32];
  541. get_user_name(id, name, 32);
  542. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(xp_cost));
  543. hnsxp_add_user_xp(id, get_pcvar_num(xp_amount));
  544. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett^x04 %i^x01 XP-t!", clantac, name, get_pcvar_num(xp_amount));
  545. bought_xp = 1;
  546. }
  547. case 3:
  548. {
  549. if ( cs_get_user_money(id) < get_pcvar_num(hp_cost) )
  550. {
  551. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Nincs eleg penzed, hogy megvedd ezt az eszkozt!", clantac);
  552. return PLUGIN_HANDLED;
  553. }
  554. if ( bought_hp == 1 )
  555. {
  556. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Mar vettel^x04 HP-t^x01 ebben a korben!", clantac);
  557. return PLUGIN_HANDLED;
  558. }
  559. new name[32];
  560. get_user_name(id, name, 32);
  561. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(hp_cost));
  562. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 '%s' vett^x04 %i^x01 HP-t!", clantac, name, get_pcvar_num(hp_amount));
  563. new health = get_user_health(id);
  564. health += get_pcvar_num(hp_amount);
  565. }
  566. }
  567. return PLUGIN_CONTINUE;
  568. }
  569.  
  570. public client_authorized(id)
  571. {
  572. gbConnected[id] = true;
  573.  
  574. if ( access(id, ADMIN_LEVEL_A) )
  575. {
  576. got_access[id] = true;
  577. }
  578. }
  579.  
  580. public client_disconnect(id)
  581. {
  582. gbConnected[id] = false;
  583. if ( got_access[id] )
  584. {
  585. got_access[id] = false;
  586. }
  587. }
  588.  
  589. public client_putinserver(id)
  590. {
  591. set_task(5.0, "Task_LogonMessage", id);
  592. g_iMoney[ id ] = -1;
  593. }
  594.  
  595. public FwdPlayerSpawn(id)
  596. {
  597. if( !gbConnected[id] )
  598. return HAM_IGNORED;
  599.  
  600. bought_respawn = 0;
  601. bought_xp = 0;
  602. bought_hp = 0;
  603. return HAM_HANDLED;
  604. }
  605.  
  606. public show_VIPHowTo(id)
  607. {
  608. show_motd(id, "extras/ultimate_vip.motd", "Hogyan kaphatok VIP-t");
  609. }
  610.  
  611. public Task_LogonMessage(id)
  612. {
  613. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 A VIP statuszanak^x04 ellenorzese^x01...", clantac);
  614. if ( got_access[id] )
  615. {
  616. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Hiba keletkezett a^x04 VIP-nal^x01!", clantac);
  617. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Ok: Meg nem lett megvasarolva a^x04 VIP^x01 !", clantac);
  618. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Ird be^x04 /vip^x01 ,hogy lasd, hogy kell^x04 VIP-t szerezni^x01!", clantac); }
  619. else
  620. {
  621. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Logged in as^x04 VIP^x01!", clantac);
  622. ColorChat(id, GREEN, "[%s] VIP Mod:^x01 Ird be^x04 /vs^x01 vagy^x04 /vshop^x01 a^x04 VIP hasznalatahoz^x01!", clantac);
  623. ColorChat(0, GREEN, "[%s] VIP Mod:^x01 Az uj^x04 VIP^x01 hozzaadva! - Ird be^x04 /vips^x01 ,hogy lasd az osszes^x04 VIP-t^x01!", clantac);
  624. }
  625. }
  626.  
  627. F_Print(id, const sMsg[], any:...)
  628. {
  629. static i; i = id ? id : get_User();
  630. if ( !i ) return;
  631.  
  632. new sMessage[256];
  633. new len = formatex(sMessage, sizeof(sMessage) - 1, "^x04^x03 ");
  634. vformat(sMessage[len], sizeof(sMessage) - 1 - len, sMsg, 3);
  635. sMessage[192] = '^0';
  636.  
  637. static msgid_SayText;
  638. if ( !msgid_SayText ) msgid_SayText = get_user_msgid("SayText");
  639.  
  640. new const team_Names[][] =
  641. {
  642. "",
  643. "TERRORIST",
  644. "CT",
  645. "SPECTATOR"
  646. };
  647.  
  648. new sTeam = get_user_team(i);
  649.  
  650. team_Info(i, id, team_Names[0]);
  651.  
  652. message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgid_SayText, _, id);
  653. write_byte(i);
  654. write_string(sMessage);
  655. message_end();
  656.  
  657. team_Info(i, id, team_Names[sTeam]);
  658. }
  659.  
  660. team_Info(receiver, sender, sTeam[])
  661. {
  662. static msgid_TeamInfo;
  663. if ( !msgid_TeamInfo ) msgid_TeamInfo = get_user_msgid("TeamInfo");
  664.  
  665. message_begin(sender ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgid_TeamInfo, _, sender);
  666. write_byte(receiver);
  667. write_string(sTeam);
  668. message_end();
  669. }
  670.  
  671.  
  672. get_User()
  673. {
  674. for ( new id = 1; id <= gMaxPlayers; id++ )
  675. {
  676. if ( gbConnected[id] )
  677. {
  678. return id;
  679. }
  680. }
  681.  
  682. return 0;
  683. }
  684. public print_vips(id2)
  685. {
  686. new vipnames[33][32]
  687. new message[256]
  688. new id, count, x, len
  689.  
  690. for(id = 1 ; id <= gMaxPlayers ; id++)
  691. if(is_user_connected(id))
  692. if( got_access[id] )
  693. get_user_name(id, vipnames[count++], 31)
  694.  
  695. len = format(message, 255, "%s ONLINE VIP: ",COLOR)
  696. if(count > 0) {
  697. for(x = 0 ; x < count ; x++) {
  698. len += format(message[len], 255-len, "%s%s ", vipnames[x], x < (count-1) ? ", ":"")
  699. if(len > 96 ) {
  700. F_Print(id2, message)
  701. len = format(message, 255, "%s ",COLOR)
  702. }
  703. }
  704. F_Print(id2, message)
  705. }
  706. else {
  707. len += format(message[len], 255-len, "Nincs jelen VIP.")
  708. F_Print(id2, message);
  709. }
  710.  
  711. new info_ifnot[64];
  712. format(info_ifnot, 63, "%s Szerver ADMIN kapcsolodik -- %s", COLOR)
  713. F_Print(id2, info_ifnot);
  714. }
  715.