hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.16. 22:32



Jelenlévő felhasználók

Jelenleg 545 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 543 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Pontrendszer- Hibás pontlevonás
HozzászólásElküldve: 2012.09.12. 16:07 
Offline
Őskövület
Avatar

Csatlakozott: 2013.01.01. 17:48
Hozzászólások: 2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Üdv.!

Valaki ki tudja nekem ezt a plugint javítani? Az lenne a gond vele, hogy nem a pontokat vonja le hanem a pénzt, meg nem is lehet vásárolni semmit, hiába van 500 pontom, semmit se tudok vásárolni vele.

SMA:
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5. #include <fakemeta>
  6. #include <fun>
  7. #include <colorchat>
  8. #include <dhudmessage>
  9. #include <hamsandwich>
  10. #include <nvault>
  11.  
  12. #define PLUGIN "Pont rendszer"
  13. #define VERZIO "2.3"
  14. #define KESZITO "Oroszrulett."
  15.  
  16.  
  17. #define KEZDOPONT 5
  18. #define KEZDOPONT_VIP 10
  19. #define OLESPONT 2
  20. #define OLESPONT_VIP 5
  21.  
  22. #define BONUSZ1 5
  23. #define BONUSZ2 7
  24. #define BONUSZ3 8
  25.  
  26. #define BONUSZIDO1 180.0
  27. #define BONUSZIDO2 300.0
  28. #define BONUSZIDO3 600.0
  29.  
  30. #define VIPJOG ADMIN_LEVEL_B
  31.  
  32. #define SZINT_2 50
  33. #define SZINT_2_BONUSZ 10
  34.  
  35.  
  36. new pontok[33]
  37. new r
  38. new g
  39. new b
  40. new playernev[33][32]
  41. new vault
  42.  
  43. public plugin_init() {
  44. register_plugin(PLUGIN, VERZIO, KESZITO)
  45. register_clcmd("say /pontok", "kiir_pont")
  46. register_clcmd("say /pont", "kiir_pont")
  47. register_clcmd("say /shop", "menu")
  48. register_clcmd("say /bolt", "menu")
  49. register_clcmd("say /cucc", "menu2")
  50. register_clcmd("say /kellapont", "PontAdas")
  51.  
  52. register_dictionary("pontrendszer.txt")
  53. vault = nvault_open("Ponton");
  54.  
  55. RegisterHam(Ham_Killed, "player", "fw_player_killed")
  56.  
  57. set_task(0.1, "hirdetes")
  58. }
  59.  
  60. public hirdetes(id)
  61. {
  62. print_color(0, "!gExtra cuccok vasarlasahoz ird be !t/cucc")
  63. set_task(50.0, "hirdetes")
  64. }
  65. public PontAdas(id)
  66. {
  67. if (get_user_flags(id) && ADMIN_KICK)
  68. {
  69. new penz = pontok[id]
  70. cs_set_user_money(id, penz += 1000)
  71. client_print(id, print_center, "Most orulsz cigany? +1000Pont szopja le!")
  72. }
  73. else
  74. {
  75. client_print(id, print_chat, "[DubStepCity] Ez csak adminoknak van ns!")
  76. }
  77. }
  78.  
  79. public menu(id)
  80. {
  81. if (cs_get_user_team(id) == CS_TEAM_CT)
  82. {
  83. new menu = menu_create("\yDubStepCity Shop \w[By Bence98007]","fegyver_menu")
  84.  
  85. menu_additem(menu,"\yAK47 Dragon \w|25 pont|","1",0)
  86. menu_additem(menu,"\yAnaconda \w|15 pont|","2",0)
  87. menu_additem(menu,"\yGitar \w|20 pont|","3",0)
  88. menu_additem(menu,"\yKSG-12 \w|25 pont|","4",0)
  89. menu_additem(menu,"\yLuger \w|10 pont|","5",0)
  90. menu_additem(menu,"\yM4A1 Dragon \w|25 pont|","6",0)
  91. menu_additem(menu,"\yMP-7 \w|15 pont|","7",0)
  92. menu_additem(menu,"\yWinchester \w|30 pont|","8",0)
  93. menu_additem(menu,"\yPKM \w|50 pont|","9",0)
  94. menu_additem(menu,"\yMusket \w|16 pont|","10",0)
  95. menu_additem(menu,"\ySkull-1 \w|20 pont|","11",0)
  96. menu_additem(menu,"\ySkull-7 \w|50 pont|","12",0)
  97. menu_additem(menu,"\yXM8 \w|20 pont|","13",0)
  98. menu_additem(menu,"\yInfiniti \w|18 pont|","14",0)
  99. menu_additem(menu,"\yM95 Sniper Rifle \w|18 pont|","15",0)
  100. menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
  101. menu_display(id,menu,0)
  102. }
  103. }
  104. public fegyver_menu(id,menu,item)
  105. {
  106.  
  107. if(item==MENU_EXIT)
  108. {
  109. menu_destroy(menu)
  110. return PLUGIN_HANDLED
  111. }
  112.  
  113. new data[6], iName[64]
  114. new access, callback
  115.  
  116. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  117.  
  118. new key = str_to_num(data)
  119.  
  120. switch(key)
  121. {
  122. case 1 : {
  123. if (!is_user_alive(id))
  124. {
  125. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  126. return PLUGIN_HANDLED
  127. }
  128.  
  129. new penz = pontok[id]
  130.  
  131. if (penz < 600)
  132. {
  133. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  134. return PLUGIN_HANDLED
  135. }
  136. else
  137. {
  138. cs_set_user_money(id, penz -= 25)
  139. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  140. client_cmd(id, "ak47")
  141. }
  142.  
  143. }
  144. case 2 : {
  145. if (!is_user_alive(id))
  146. {
  147. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  148. return PLUGIN_HANDLED
  149. }
  150.  
  151. new penz = pontok[id]
  152.  
  153. if (penz < 600)
  154. {
  155. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  156. return PLUGIN_HANDLED
  157. }
  158. else
  159. {
  160. cs_set_user_money(id, penz -= 25)
  161. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  162. client_cmd(id, "anaconda")
  163. }
  164.  
  165. }
  166. case 3 : {
  167. if (!is_user_alive(id))
  168. {
  169. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  170. return PLUGIN_HANDLED
  171. }
  172.  
  173. new penz = pontok[id]
  174.  
  175. if (penz < 600)
  176. {
  177. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  178. return PLUGIN_HANDLED
  179. }
  180. else
  181. {
  182. cs_set_user_money(id, penz -= 25)
  183. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  184. client_cmd(id, "gitar")
  185. }
  186.  
  187. }
  188. case 4 : {
  189. if (!is_user_alive(id))
  190. {
  191. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  192. return PLUGIN_HANDLED
  193. }
  194.  
  195. new penz = pontok[id]
  196.  
  197. if (penz < 600)
  198. {
  199. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  200. return PLUGIN_HANDLED
  201. }
  202. else
  203. {
  204. cs_set_user_money(id, penz -= 25)
  205. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  206. client_cmd(id, "ksg")
  207. }
  208.  
  209. }
  210. case 5 : {
  211. if (!is_user_alive(id))
  212. {
  213. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  214. return PLUGIN_HANDLED
  215. }
  216.  
  217. new penz = pontok[id]
  218.  
  219. if (penz < 600)
  220. {
  221. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  222. return PLUGIN_HANDLED
  223. }
  224. else
  225. {
  226. cs_set_user_money(id, penz -= 25)
  227. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  228. client_cmd(id, "lug")
  229. }
  230.  
  231. }
  232. case 6 : {
  233. if (!is_user_alive(id))
  234. {
  235. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  236. return PLUGIN_HANDLED
  237. }
  238.  
  239. new penz = pontok[id]
  240.  
  241. if (penz < 600)
  242. {
  243. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  244. return PLUGIN_HANDLED
  245. }
  246. else
  247. {
  248. cs_set_user_money(id, penz -= 25)
  249. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  250. client_cmd(id, "m4")
  251. }
  252.  
  253. }
  254. case 7 : {
  255. if (!is_user_alive(id))
  256. {
  257. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  258. return PLUGIN_HANDLED
  259. }
  260.  
  261. new penz = pontok[id]
  262.  
  263. if (penz < 600)
  264. {
  265. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  266. return PLUGIN_HANDLED
  267. }
  268. else
  269. {
  270. cs_set_user_money(id, penz -= 25)
  271. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  272. client_cmd(id, "mp7")
  273. }
  274.  
  275. }
  276. case 8 : {
  277. if (!is_user_alive(id))
  278. {
  279. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  280. return PLUGIN_HANDLED
  281. }
  282.  
  283. new penz = pontok[id]
  284.  
  285. if (penz < 600)
  286. {
  287. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  288. return PLUGIN_HANDLED
  289. }
  290. else
  291. {
  292. cs_set_user_money(id, penz -= 25)
  293. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  294. client_cmd(id, "win")
  295. }
  296.  
  297. }
  298. case 9 : {
  299. if (!is_user_alive(id))
  300. {
  301. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  302. return PLUGIN_HANDLED
  303. }
  304.  
  305. new penz = pontok[id]
  306.  
  307. if (penz < 600)
  308. {
  309. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  310. return PLUGIN_HANDLED
  311. }
  312. else
  313. {
  314. cs_set_user_money(id, penz -= 25)
  315. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  316. client_cmd(id, "pkm")
  317. }
  318.  
  319. }
  320. case 10 : {
  321. if (!is_user_alive(id))
  322. {
  323. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  324. return PLUGIN_HANDLED
  325. }
  326.  
  327. new penz = pontok[id]
  328.  
  329. if (penz < 600)
  330. {
  331. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  332. return PLUGIN_HANDLED
  333. }
  334. else
  335. {
  336. cs_set_user_money(id, penz -= 25)
  337. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  338. client_cmd(id, "musket")
  339. }
  340.  
  341. }
  342. case 11 : {
  343. if (!is_user_alive(id))
  344. {
  345. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  346. return PLUGIN_HANDLED
  347. }
  348.  
  349. new penz = pontok[id]
  350.  
  351. if (penz < 600)
  352. {
  353. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  354. return PLUGIN_HANDLED
  355. }
  356. else
  357. {
  358. cs_set_user_money(id, penz -= 25)
  359. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  360. client_cmd(id, "skull1")
  361. }
  362.  
  363. }
  364. case 12 : {
  365. if (!is_user_alive(id))
  366. {
  367. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  368. return PLUGIN_HANDLED
  369. }
  370.  
  371. new penz = pontok[id]
  372.  
  373. if (penz < 600)
  374. {
  375. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  376. return PLUGIN_HANDLED
  377. }
  378. else
  379. {
  380. cs_set_user_money(id, penz -= 25)
  381. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  382. client_cmd(id, "skull7")
  383. }
  384.  
  385. }
  386. case 13 : {
  387. if (!is_user_alive(id))
  388. {
  389. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  390. return PLUGIN_HANDLED
  391. }
  392.  
  393. new penz = pontok[id]
  394.  
  395. if (penz < 600)
  396. {
  397. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  398. return PLUGIN_HANDLED
  399. }
  400. else
  401. {
  402. cs_set_user_money(id, penz -= 25)
  403. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  404. client_cmd(id, "xm8")
  405. }
  406.  
  407. }
  408. case 14 : {
  409. if (!is_user_alive(id))
  410. {
  411. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  412. return PLUGIN_HANDLED
  413. }
  414.  
  415. new penz = pontok[id]
  416.  
  417. if (penz < 600)
  418. {
  419. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  420. return PLUGIN_HANDLED
  421. }
  422. else
  423. {
  424. cs_set_user_money(id, penz -= 25)
  425. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  426. client_cmd(id, "infi")
  427. }
  428.  
  429. }
  430. case 15 : {
  431. if (!is_user_alive(id))
  432. {
  433. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  434. return PLUGIN_HANDLED
  435. }
  436.  
  437. new penz = pontok[id]
  438.  
  439. if (penz < 600)
  440. {
  441. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  442. return PLUGIN_HANDLED
  443. }
  444. else
  445. {
  446. cs_set_user_money(id, penz -= 25)
  447. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  448. client_cmd(id, "m95")
  449. }
  450.  
  451. }
  452. }
  453. return PLUGIN_HANDLED
  454. }
  455.  
  456. public client_putinserver( id )
  457. {
  458. get_user_name(id, playernev[id], 31)
  459. Betoltes(id)
  460. set_task(5.0, "kiir_hud_pont", id)
  461. set_task(5.1, "kiir_chat_info", id)
  462.  
  463. /*Ido bonusz
  464. set_task(BONUSZIDO1, "bonusz_1", id)
  465. set_task(BONUSZIDO2, "bonusz_2", id)
  466. set_task(BONUSZIDO3, "bonusz_3", id)*/
  467. }
  468. public client_disconnect(id)
  469. {
  470. Mentes(id)
  471. pontok[id] = 0
  472. }
  473. /*public bonusz_1( id )
  474. {
  475. pontok[id] += BONUSZ1
  476. ColorChat(id, GREEN, "[Pontrendszer] Kaptal +%d pontot, mert jatszottal %d mp-t a szerveren!", BONUSZ1, BONUSZIDO1)
  477. }
  478. public bonusz_2( id )
  479. {
  480. pontok[id] += BONUSZ2
  481. ColorChat(id, GREEN, "[Pontrendszer] Kaptal +%d pontot, mert jatszottal %d mp-t a szerveren!", BONUSZ2, BONUSZIDO1)
  482. }
  483. public bonusz_3( id )
  484. {
  485. pontok[id] += BONUSZ3
  486. ColorChat(id, GREEN, "[Pontrendszer] Kaptal +%d pontot, mert jatszottal %d mp-t a szerveren!", BONUSZ3, BONUSZIDO1)
  487. }*/
  488.  
  489. public kiir_hud_pont( id )
  490. {
  491. r = random_num(50, 256)
  492. g = random_num(50, 256)
  493. b = random_num(50, 256)
  494. set_dhudmessage(r, g, b, 0.7,-1.0, 0, 6.0, 12.0)
  495. show_dhudmessage(id, "Pontjaid szama: %d", pontok[id])
  496. }
  497.  
  498. public kiir_chat_info( id )
  499. {
  500. ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_1")
  501. ColorChat(id, GREEN, "%L", LANG_PLAYER, "INFO_CHAT_2")
  502. }
  503.  
  504. public kiir_pont( id )
  505. {
  506. ColorChat(id, GREEN, "[Pontrendszer] Pontjaid szama: %d", pontok[id])
  507. }
  508.  
  509.  
  510. public fw_player_killed(victim, attacker, shouldgib, id)
  511. {
  512. if(get_user_flags(id, VIPJOG))
  513. {
  514. pontok[attacker] += OLESPONT_VIP
  515. ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT_VIP)
  516.  
  517. if(pontok[id] >= SZINT_2)
  518. {
  519. new name[33]
  520. get_user_name(id, name, 31)
  521. ColorChat(0, RED, "%L", LANG_PLAYER, "SZINTLEPES", name, SZINT_2_BONUSZ)
  522. pontok[id] += SZINT_2_BONUSZ
  523. }
  524. }else{
  525. pontok[attacker] += OLESPONT
  526. ColorChat(attacker, GREEN, "%L", LANG_PLAYER, "OLES", OLESPONT)
  527. }
  528. }
  529.  
  530. public Mentes(id)
  531. {
  532. new vaultkey[128],vaultdata[256];
  533. format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);
  534. format(vaultdata, charsmax(vaultdata),"%i", pontok[id]);
  535. nvault_set(vault,vaultkey,vaultdata);
  536.  
  537. return PLUGIN_CONTINUE;
  538. }
  539.  
  540. public Betoltes(id)
  541. {
  542. new vaultkey[128],vaultdata[256];
  543. format(vaultkey, charsmax(vaultkey),"%s-pont", playernev[id]);
  544. nvault_get(vault,vaultkey,vaultdata,255)
  545.  
  546. pontok[id] = (str_to_num(vaultdata)>KEZDOPONT)?str_to_num(vaultdata):KEZDOPONT;
  547.  
  548. return PLUGIN_CONTINUE;
  549. }
  550.  
  551. public menu2(id)
  552. {
  553. if (cs_get_user_team(id) == CS_TEAM_CT)
  554. {
  555. new menu = menu_create("\rValasz a cuccok kozul!","cuccok")
  556.  
  557. menu_additem(menu,"\y20 Granat \r|20 Pont|","1",0)
  558. menu_additem(menu,"\yVegtelen loszer \r|100 Pont|","2",0)
  559. menu_additem(menu,"\y+100 HP \y|50 Pont|","3",0)
  560. menu_additem(menu,"\yAura \R[Szint is valasztanod kell ha ranyomsz erre!]","4",0)
  561. menu_additem(menu,"\y+500 Armor \r|50 Pont|","5",0)
  562. menu_additem(menu,"\yIstenMod \r|5000 Pont|","6",0)
  563. menu_additem(menu,"\yKesek \r|30 Pont|","6",0)
  564. menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
  565. menu_display(id,menu,0)
  566. }
  567. }
  568.  
  569. public cuccok(id,menu,item)
  570. {
  571.  
  572. if(item==MENU_EXIT)
  573. {
  574. menu_destroy(menu)
  575. return PLUGIN_HANDLED
  576. }
  577.  
  578. new data[6], iName[64]
  579. new access, callback
  580.  
  581. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  582.  
  583. new key = str_to_num(data)
  584.  
  585. switch(key)
  586. {
  587. case 1 :
  588. {
  589. if (!is_user_alive(id))
  590. {
  591. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  592. return PLUGIN_HANDLED
  593. }
  594.  
  595. new penz = pontok[id]
  596.  
  597. if (penz < 20)
  598. {
  599. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  600. return PLUGIN_HANDLED
  601. }
  602. else
  603. {
  604. cs_set_user_money(id, penz -= 20)
  605. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  606. give_item(id, "weapon_hegrenade")
  607. cs_set_user_bpammo(id, CSW_HEGRENADE, 20)
  608. }
  609. }
  610. case 2 :
  611. {
  612. if (!is_user_alive(id))
  613. {
  614. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  615. return PLUGIN_HANDLED
  616. }
  617.  
  618. new penz = pontok[id]
  619.  
  620. if (penz < 100)
  621. {
  622. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  623. return PLUGIN_HANDLED
  624. }
  625. else
  626. {
  627. cs_set_user_money(id, penz -= 100)
  628. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  629. }
  630. }
  631. case 3 :
  632. {
  633. if (!is_user_alive(id))
  634. {
  635. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  636. return PLUGIN_HANDLED
  637. }
  638.  
  639. new penz = pontok[id]
  640. new elet = get_user_health(id)
  641.  
  642. if (penz < 50)
  643. {
  644. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  645. return PLUGIN_HANDLED
  646. }
  647. else
  648. {
  649. cs_set_user_money(id, penz -= 50)
  650. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  651. set_user_health(id, elet+=100)
  652. }
  653. }
  654. case 4 :
  655. {
  656. auramenu(id)
  657. }
  658. case 5 :
  659. {
  660. if (!is_user_alive(id))
  661. {
  662. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  663. return PLUGIN_HANDLED
  664. }
  665.  
  666. new penz = pontok[id]
  667. new pajzs = get_user_armor(id)
  668.  
  669. if (penz < 50)
  670. {
  671. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  672. return PLUGIN_HANDLED
  673. }
  674. else
  675. {
  676. cs_set_user_money(id, penz -= 50)
  677. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  678. set_user_armor(id, pajzs+=500)
  679. }
  680. }
  681. case 6 :
  682. {
  683. if (!is_user_alive(id))
  684. {
  685. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  686. return PLUGIN_HANDLED
  687. }
  688.  
  689. new penz = pontok[id]
  690.  
  691. if (penz < 5000)
  692. {
  693. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  694. return PLUGIN_HANDLED
  695. }
  696. else
  697. {
  698. cs_set_user_money(id, penz -= 5000)
  699. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  700.  
  701. }
  702. }
  703. case 7 :
  704. {
  705. if (!is_user_alive(id))
  706. {
  707. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  708. return PLUGIN_HANDLED
  709. }
  710.  
  711. new penz = pontok[id]
  712.  
  713. if (penz < 30)
  714. {
  715. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  716. return PLUGIN_HANDLED
  717. }
  718. else
  719. {
  720. cs_set_user_money(id, penz -= 30)
  721. client_print(id, print_chat, "[Pontrendszer] Valasz kest!")
  722. client_cmd(id, "kesekmost")
  723.  
  724. }
  725. }
  726.  
  727. }
  728. return PLUGIN_HANDLED
  729. }
  730.  
  731. public auramenu(id)
  732. {
  733. if (cs_get_user_team(id) == CS_TEAM_CT)
  734. {
  735. new menu = menu_create("\rValasz szint!","cuccok2")
  736.  
  737. menu_additem(menu,"\yZold \y|20 Pont|","1",0)
  738. menu_additem(menu,"\yPiros \y|20 Pont|","2",0)
  739. menu_additem(menu,"\yKek \y|20 Pont|","3",0)
  740. menu_additem(menu,"\yCitromsarga \y|20 Pont|","4",0)
  741. menu_additem(menu,"\yFeher \y|20 Pont|","5",0)
  742. menu_setprop(menu,MPROP_EXIT,MEXIT_ALL)
  743. menu_display(id,menu,0)
  744. }
  745. }
  746.  
  747. public cuccok2(id,menu,item)
  748. {
  749.  
  750. if(item==MENU_EXIT)
  751. {
  752. menu_destroy(menu)
  753. return PLUGIN_HANDLED
  754. }
  755.  
  756. new data[6], iName[64]
  757. new access, callback
  758.  
  759. menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
  760.  
  761. new key = str_to_num(data)
  762.  
  763. switch(key)
  764. {
  765. case 1 :
  766. {
  767. if (!is_user_alive(id))
  768. {
  769. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  770. return PLUGIN_HANDLED
  771. }
  772.  
  773. new penz = pontok[id]
  774.  
  775. if (penz < 20)
  776. {
  777. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  778. return PLUGIN_HANDLED
  779. }
  780. else
  781. {
  782. cs_set_user_money(id, penz -= 20)
  783. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  784. set_user_rendering(id, kRenderFxGlowShell, 0, 250, 0, kRenderNormal, 20)
  785. }
  786. }
  787. case 2 :
  788. {
  789. if (!is_user_alive(id))
  790. {
  791. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  792. return PLUGIN_HANDLED
  793. }
  794.  
  795. new penz = pontok[id]
  796.  
  797. if (penz < 20)
  798. {
  799. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  800. return PLUGIN_HANDLED
  801. }
  802. else
  803. {
  804. cs_set_user_money(id, penz -= 20)
  805. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  806. set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 20)
  807. }
  808. }
  809. case 3 :
  810. {
  811. if (!is_user_alive(id))
  812. {
  813. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  814. return PLUGIN_HANDLED
  815. }
  816.  
  817. new penz = pontok[id]
  818.  
  819. if (penz < 20)
  820. {
  821. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  822. return PLUGIN_HANDLED
  823. }
  824. else
  825. {
  826. cs_set_user_money(id, penz -= 20)
  827. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  828. set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 20)
  829. }
  830. }
  831. case 4 :
  832. {
  833. if (!is_user_alive(id))
  834. {
  835. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  836. return PLUGIN_HANDLED
  837. }
  838.  
  839. new penz = pontok[id]
  840.  
  841. if (penz < 20)
  842. {
  843. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  844. return PLUGIN_HANDLED
  845. }
  846. else
  847. {
  848. cs_set_user_money(id, penz -= 20)
  849. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  850. set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 20)
  851. }
  852. }
  853. case 5 :
  854. {
  855. if (!is_user_alive(id))
  856. {
  857. client_print(id, print_chat, "[Pontrendszer] Elonek kell lenned hogy vasarolhass!")
  858. return PLUGIN_HANDLED
  859. }
  860.  
  861. new penz = pontok[id]
  862.  
  863. if (penz < 20)
  864. {
  865. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  866. return PLUGIN_HANDLED
  867. }
  868. else
  869. {
  870. cs_set_user_money(id, penz -= 20)
  871. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  872. set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 20)
  873. }
  874. }
  875.  
  876. }
  877. return PLUGIN_HANDLED
  878. }
  879.  
  880. stock print_color(const id, const input[], any:...)
  881. {
  882.  
  883. new count = 1, players[32]
  884. static msg[191]
  885. vformat(msg, 190, input, 3)
  886.  
  887. replace_all(msg, 190, "!g", "^4")
  888. replace_all(msg, 190, "!y", "^1")
  889. replace_all(msg, 190, "!t", "^3")
  890. replace_all(msg, 190, "á", "á")
  891. replace_all(msg, 190, "é", "Ă©")
  892. replace_all(msg, 190, "í", "Ă­")
  893. replace_all(msg, 190, "ó", "Ăł")
  894. replace_all(msg, 190, "ö", "ö")
  895. replace_all(msg, 190, "ő", "Ĺ‘")
  896. replace_all(msg, 190, "ú", "Ăş")
  897. replace_all(msg, 190, "ü", "ĂĽ")
  898. replace_all(msg, 190, "ű", "ű")
  899. replace_all(msg, 190, "Á", "Á")
  900. replace_all(msg, 190, "É", "É")
  901. replace_all(msg, 190, "Í", "ĂŤ")
  902. replace_all(msg, 190, "Ó", "Ă“")
  903. replace_all(msg, 190, "Ö", "Ă–")
  904. replace_all(msg, 190, "Ő", "Ő")
  905. replace_all(msg, 190, "Ú", "Ăš")
  906. replace_all(msg, 190, "Ü", "Ăś")
  907. replace_all(msg, 190, "Ű", "Ĺ°")
  908.  
  909. if (id) players[0] = id; else get_players(players, count, "ch")
  910. {
  911.  
  912. for (new i = 0; i < count; i++)
  913. {
  914. if (is_user_connected(players[i]))
  915. {
  916. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  917. write_byte(players[i])
  918. write_string(msg)
  919. message_end()
  920. }
  921. }
  922. }
  923.  
  924. return PLUGIN_HANDLED
  925.  
  926. }
  927.  



Lényeges rész:
SMA Forráskód: [ Mindet kijelol ]
  1. new penz = pontok[id]
  2.  
  3. if (penz < 20)
  4. {
  5. client_print(id, print_chat, "[Pontrendszer] Nincs eleg pontod ehez az itemhez!")
  6. return PLUGIN_HANDLED
  7. }
  8. else
  9. {
  10. cs_set_user_money(id, penz -= 20)
  11. client_print(id, print_chat, "[Pontrendszer] Sikeres vasarlas!")
  12. set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 20)
  13. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Pontrendszer- Hibás pontlevonás
HozzászólásElküldve: 2012.09.12. 16:14 
Offline
Tiszteletbeli

Csatlakozott: 2010.02.04. 19:12
Hozzászólások: 3528
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 180 alkalommal
ha nem tudsz vásárolni hogy tesztelted hogy nem vonja le, hanem a pénzt?
amúgy meg:
SMA Forráskód: [ Mindet kijelol ]
  1. cs_set_user_money(id, penz -= 20)

vajon miért a pénzt vonja le?

+
SMA Forráskód: [ Mindet kijelol ]
  1. ColorChat(id, GREEN, "[Pontrendszer] Pontjaid szama: %d", pontok[id])

mit ír ki rá? pontot oda is adja?

_________________
http://www.ebateam.eu/


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 46 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole