hlmod.hu
https://hlmod.hu/

Item limit?
https://hlmod.hu/viewtopic.php?f=9&t=9553
Oldal: 1 / 2

Szerző:  ltscavo [ 2013.07.16. 17:46 ]
Hozzászólás témája:  Item limit?

Olyan kód kellene, nekem hogy ha belerakom az sma-ba akkor:

Korlátozza azt az extra cuccot, de nem úgy hogy 1 körben pl 3x veheti meg, hanem, hogy egy PÁLYÁN.
Nos ezt az extra cuccok nemesis vételére akarnám pl. hogy egy ember 1x veheti meg 1 mapon!

köszönöm

Szerző:  Tomos [ 2013.07.16. 18:13 ]
Hozzászólás témája:  Re: Item limit?

ltscavo írta:
Olyan kód kellene, nekem hogy ha belerakom az sma-ba akkor:

Korlátozza azt az extra cuccot, de nem úgy hogy 1 körben pl 3x veheti meg, hanem, hogy egy PÁLYÁN.
Nos ezt az extra cuccok nemesis vételére akarnám pl. hogy egy ember 1x veheti meg 1 mapon!

köszönöm


Itt le van írva https://forums.alliedmods.net/showthread.php?t=205724

Szerző:  ltscavo [ 2013.07.16. 18:17 ]
Hozzászólás témája:  Re: Item limit?

Tomos írta:
ltscavo írta:
Olyan kód kellene, nekem hogy ha belerakom az sma-ba akkor:

Korlátozza azt az extra cuccot, de nem úgy hogy 1 körben pl 3x veheti meg, hanem, hogy egy PÁLYÁN.
Nos ezt az extra cuccok nemesis vételére akarnám pl. hogy egy ember 1x veheti meg 1 mapon!

köszönöm


Itt le van írva https://forums.alliedmods.net/showthread.php?t=205724


hát ebből nem sokat értettem:( és ez pályára korlátozza csak körre?

Szerző:  kiki [ 2013.07.16. 18:22 ]
Hozzászólás témája:  Re: Item limit?

Rakd fel a zp nemesis extra item smajat s megcsinalom delelott, ha addig mas nem csinalja meg.

Szerző:  ltscavo [ 2013.07.16. 18:38 ]
Hozzászólás témája:  Re: Item limit?

kiki írta:
Rakd fel a zp nemesis extra item smajat s megcsinalom delelott, ha addig mas nem csinalja meg.


rendben köszönöm, de egybe van a túlélővel.
úgy hogy 1 játékos 1 mapon csak 1x veheti meg!

Ő ugyanezt a plugint át lehet írni assassin+sniper-re ? csak a neveket cseréljem ki vagy hogy? csak mert van ahhoz is ilyen extra cuccom, viszont ez jobb tehát annak a vétele össze-vissza van.


NEMESIS+SURVIVOR:
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <zombieplague>
  5. #include <zmvip>
  6.  
  7. #define PLUGIN "[ZP] S/N Buy"
  8. #define VERSION "1.1"
  9. #define AUTHOR "aaarnas"
  10.  
  11. new g_msgSayText
  12. new nemesis, survivor
  13. new g_bought[33], bought
  14. new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. cvar_everytime = register_cvar("zp_allow_buy", "2")
  19. cvar_allow_times = register_cvar("zp_allow_times", "4")
  20. cvar_limit_all = register_cvar("zp_limit_for_all", "1")
  21. cvar_n_price = register_cvar("zp_nemesis_price", "35")
  22. cvar_s_price = register_cvar("zp_survivor_price", "35")
  23. cvar_show_bought = register_cvar("zp_show_who_bought", "1")
  24.  
  25. g_msgSayText = get_user_msgid("SayText")
  26.  
  27. // Extra items
  28. nemesis = zv_register_extra_item("Nemesis", "Egy korig", get_pcvar_num(cvar_n_price), 0)
  29. survivor = zv_register_extra_item("Tulelo","Egy korig", get_pcvar_num(cvar_s_price), 0)
  30. }
  31.  
  32. public zp_round_ended()
  33. bought = false
  34.  
  35. public zv_extra_item_selected(id, itemid) {
  36.  
  37. new value = get_pcvar_num(cvar_everytime)
  38.  
  39. if(itemid == nemesis) {
  40.  
  41. if(get_pcvar_num(cvar_limit_all) && bought) {
  42. client_printcolor(id, "/g[LTS ZP]/y Nem veheted meg, probald kesobb!
  43. return ZV_PLUGIN_HANDLED
  44. }
  45. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  46. client_printcolor(id, "/g[LTS ZP]!/y Nem vehetsz tobbet.", get_pcvar_num(cvar_allow_times))
  47. return ZV_PLUGIN_HANDLED
  48. }
  49. if(value == 2) {
  50. zp_make_user_nemesis(id)
  51. new name[64]
  52. get_user_name(id, name, 63)
  53. client_printcolor(0, "/g[LTS ZP] %s /yNemesist vasarolt!", name)
  54. g_bought[id]++
  55. }
  56. else if(zp_has_round_started() == value) {
  57. zp_make_user_nemesis(id)
  58. if(get_pcvar_num(cvar_show_bought)) {
  59. new name[64]
  60. get_user_name(id, name, 63)
  61. client_printcolor(0, "/g[LTS ZP] %s /yNemesist vasarolt!", name)
  62. g_bought[id]++
  63. bought = true
  64. }
  65. }
  66. else {
  67. client_printcolor(id, "/g[ZP] /yYou can buy Nemesis only when %s.", value ? "round started":"round not started")
  68. return ZV_PLUGIN_HANDLED
  69. }
  70. }
  71. else if(itemid == survivor) {
  72.  
  73. if(get_pcvar_num(cvar_limit_all) && bought) {
  74. client_printcolor(id, "/g[LTS ZP]/y Most nem tudod megvasarolni, probald kesobb".)
  75. return ZV_PLUGIN_HANDLED
  76. }
  77. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  78. client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
  79. return ZV_PLUGIN_HANDLED
  80. }
  81. if(value == 2) {
  82. zp_make_user_survivor(id)
  83. new name[64]
  84. get_user_name(id, name, 63)
  85. client_printcolor(0, "/g[LTS ZP] %s /yTulelot vasarolt", name)
  86. g_bought[id]++
  87. }
  88. else if(zp_has_round_started() == value) {
  89. zp_make_user_survivor(id)
  90. if(get_pcvar_num(cvar_show_bought)) {
  91. new name[64]
  92. get_user_name(id, name, 63)
  93. client_printcolor(0, "/g[LTS ZP] %s /yTulelot vasarolt", name)
  94. g_bought[id]++
  95. bought = true
  96. }
  97. }
  98. else {
  99. client_printcolor(id, "/g[LTS ZP] /yYou can buy Survivor only when %s.", value ? "round started":"round not started")
  100. return ZV_PLUGIN_HANDLED
  101. }
  102. }
  103. return 1
  104. }
  105.  
  106. stock client_printcolor(const id, const input[], any:...)
  107. {
  108. new iCount = 1, iPlayers[32]
  109.  
  110. static szMsg[191]
  111. vformat(szMsg, charsmax(szMsg), input, 3)
  112.  
  113. replace_all(szMsg, 190, "/g", "^4") // green txt
  114. replace_all(szMsg, 190, "/y", "^1") // orange txt
  115. replace_all(szMsg, 190, "/ctr", "^3") // team txt
  116. replace_all(szMsg, 190, "/w", "^0") // team txt
  117.  
  118. if(id) iPlayers[0] = id
  119. else get_players(iPlayers, iCount, "ch")
  120.  
  121. for (new i = 0; i < iCount; i++)
  122. {
  123. if (is_user_connected(iPlayers[i]))
  124. {
  125. message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
  126. write_byte(iPlayers[i])
  127. write_string(szMsg)
  128. message_end()
  129. }
  130. }
  131. }
  132.  

Szerző:  kiki [ 2013.07.18. 08:36 ]
Hozzászólás témája:  Re: Item limit?

Na várj, én ebbe bele sem nyúlok, addig amég nem adsz olyan forráskódót ami hibátlan, ezt ránézésre nem is engedi lefordítani.

Szerző:  ltscavo [ 2013.07.18. 11:54 ]
Hozzászólás témája:  Re: Item limit?

kiki írta:
Na várj, én ebbe bele sem nyúlok, addig amég nem adsz olyan forráskódót ami hibátlan, ezt ránézésre nem is engedi lefordítani.


tess, ezt nekem le is fordítja..
viszont lehet hogy rossz plugint használok? Csak mert, ha megveszem a kőr előtt(10mp visszaszámlálás) akkor ugyanúgy van fertőzés tehát volt, hogy átdobott túlélőbe.. :(

SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <zombieplague>
  5. #include <zmvip>
  6.  
  7. #define PLUGIN "[ZP] S/N Buy"
  8. #define VERSION "1.1"
  9. #define AUTHOR "aaarnas"
  10.  
  11. new g_msgSayText
  12. new nemesis, survivor
  13. new g_bought[33], bought
  14. new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. cvar_everytime = register_cvar("zp_allow_buy", "2")
  19. cvar_allow_times = register_cvar("zp_allow_times", "4")
  20. cvar_limit_all = register_cvar("zp_limit_for_all", "1")
  21. cvar_n_price = register_cvar("zp_nemesis_price", "35")
  22. cvar_s_price = register_cvar("zp_survivor_price", "35")
  23. cvar_show_bought = register_cvar("zp_show_who_bought", "1")
  24.  
  25. g_msgSayText = get_user_msgid("SayText")
  26.  
  27. // Extra items
  28. nemesis = zv_register_extra_item("Nemesis", "Egy korig", get_pcvar_num(cvar_n_price), 0)
  29. survivor = zv_register_extra_item("Tulelo","Egy korig", get_pcvar_num(cvar_s_price), 0)
  30. }
  31.  
  32. public zp_round_ended()
  33. bought = false
  34.  
  35. public zv_extra_item_selected(id, itemid) {
  36.  
  37. new value = get_pcvar_num(cvar_everytime)
  38.  
  39. if(itemid == nemesis) {
  40.  
  41. if(get_pcvar_num(cvar_limit_all) && bought) {
  42. client_printcolor(id, "/g[LTS ZP]/y Nem veheted meg, probald kesobb!
  43. return ZV_PLUGIN_HANDLED
  44. }
  45. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  46. client_printcolor(id, "/g[LTS ZP]!/y Nem vehetsz tobbet.", get_pcvar_num(cvar_allow_times))
  47. return ZV_PLUGIN_HANDLED
  48. }
  49. if(value == 2) {
  50. zp_make_user_nemesis(id)
  51. new name[64]
  52. get_user_name(id, name, 63)
  53. client_printcolor(0, "/g[LTS ZP] %s /yNemesist vasarolt!", name)
  54. g_bought[id]++
  55. }
  56. else if(zp_has_round_started() == value) {
  57. zp_make_user_nemesis(id)
  58. if(get_pcvar_num(cvar_show_bought)) {
  59. new name[64]
  60. get_user_name(id, name, 63)
  61. client_printcolor(0, "/g[LTS ZP] %s /yNemesist vasarolt!", name)
  62. g_bought[id]++
  63. bought = true
  64. }
  65. }
  66. else {
  67. client_printcolor(id, "/g[ZP] /yYou can buy Nemesis only when %s.", value ? "round started":"round not started")
  68. return ZV_PLUGIN_HANDLED
  69. }
  70. }
  71. else if(itemid == survivor) {
  72.  
  73. if(get_pcvar_num(cvar_limit_all) && bought) {
  74. client_printcolor(id, "/g[LTS ZP]/y Most nem tudod megvasarolni, probald kesobb".)
  75. return ZV_PLUGIN_HANDLED
  76. }
  77. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  78. client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
  79. return ZV_PLUGIN_HANDLED
  80. }
  81. if(value == 2) {
  82. zp_make_user_survivor(id)
  83. new name[64]
  84. get_user_name(id, name, 63)
  85. client_printcolor(0, "/g[LTS ZP] %s /yTulelot vasarolt", name)
  86. g_bought[id]++
  87. }
  88. else if(zp_has_round_started() == value) {
  89. zp_make_user_survivor(id)
  90. if(get_pcvar_num(cvar_show_bought)) {
  91. new name[64]
  92. get_user_name(id, name, 63)
  93. client_printcolor(0, "/g[LTS ZP] %s /yTulelot vasarolt", name)
  94. g_bought[id]++
  95. bought = true
  96. }
  97. }
  98. else {
  99. client_printcolor(id, "/g[LTS ZP] /yYou can buy Survivor only when %s.", value ? "round started":"round not started")
  100. return ZV_PLUGIN_HANDLED
  101. }
  102. }
  103. return 1
  104. }
  105.  
  106. stock client_printcolor(const id, const input[], any:...)
  107. {
  108. new iCount = 1, iPlayers[32]
  109.  
  110. static szMsg[191]
  111. vformat(szMsg, charsmax(szMsg), input, 3)
  112.  
  113. replace_all(szMsg, 190, "/g", "^4") // green txt
  114. replace_all(szMsg, 190, "/y", "^1") // orange txt
  115. replace_all(szMsg, 190, "/ctr", "^3") // team txt
  116. replace_all(szMsg, 190, "/w", "^0") // team txt
  117.  
  118. if(id) iPlayers[0] = id
  119. else get_players(iPlayers, iCount, "ch")
  120.  
  121. for (new i = 0; i < iCount; i++)
  122. {
  123. if (is_user_connected(iPlayers[i]))
  124. {
  125. message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
  126. write_byte(iPlayers[i])
  127. write_string(szMsg)
  128. message_end()
  129. }
  130. }
  131. }
  132.  

Szerző:  Metal [ 2013.07.18. 12:07 ]
Hozzászólás témája:  Re: Item limit?

Akkor jelentkezz Nobel díjra, mert azt akárhogy nézem (én is) soha sem fog lefordulni...

Szerző:  ltscavo [ 2013.07.18. 12:18 ]
Hozzászólás témája:  Re: Item limit?

Metal írta:
Akkor jelentkezz Nobel díjra, mert azt akárhogy nézem (én is) soha sem fog lefordulni...


:O tényleg.. na itt a normális:

SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <zombieplague>
  5. #include <zmvip>
  6.  
  7. #define PLUGIN "[ZP] S/N Buy"
  8. #define VERSION "1.1"
  9. #define AUTHOR "aaarnas"
  10.  
  11. new g_msgSayText
  12. new nemesis, survivor
  13. new g_bought[33], bought
  14. new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times
  15.  
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. cvar_everytime = register_cvar("zp_allow_buy", "1")
  19. cvar_allow_times = register_cvar("zp_allow_times", "4")
  20. cvar_limit_all = register_cvar("zp_limit_for_all", "1")
  21. cvar_n_price = register_cvar("zp_nemesis_price", "35")
  22. cvar_s_price = register_cvar("zp_survivor_price", "35")
  23. cvar_show_bought = register_cvar("zp_show_who_bought", "1")
  24.  
  25. g_msgSayText = get_user_msgid("SayText")
  26.  
  27. // Extra items
  28. nemesis = zv_register_extra_item("Buy Nemesis", "For one round", get_pcvar_num(cvar_n_price), 0)
  29. survivor = zv_register_extra_item("Buy Survivor","For one round", get_pcvar_num(cvar_s_price), 0)
  30. }
  31.  
  32. public zp_round_ended()
  33. bought = false
  34.  
  35. public zv_extra_item_selected(id, itemid) {
  36.  
  37. new value = get_pcvar_num(cvar_everytime)
  38.  
  39. if(itemid == nemesis) {
  40.  
  41. if(get_pcvar_num(cvar_limit_all) && bought) {
  42. client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
  43. return ZV_PLUGIN_HANDLED
  44. }
  45. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  46. client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
  47. return ZV_PLUGIN_HANDLED
  48. }
  49. if(value == 2) {
  50. zp_make_user_nemesis(id)
  51. new name[64]
  52. get_user_name(id, name, 63)
  53. client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
  54. g_bought[id]++
  55. }
  56. else if(zp_has_round_started() == value) {
  57. zp_make_user_nemesis(id)
  58. if(get_pcvar_num(cvar_show_bought)) {
  59. new name[64]
  60. get_user_name(id, name, 63)
  61. client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
  62. g_bought[id]++
  63. bought = true
  64. }
  65. }
  66. else {
  67. client_printcolor(id, "/g[ZP] /yYou can buy Nemesis only when %s.", value ? "round started":"round not started")
  68. return ZV_PLUGIN_HANDLED
  69. }
  70. }
  71. else if(itemid == survivor) {
  72.  
  73. if(get_pcvar_num(cvar_limit_all) && bought) {
  74. client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
  75. return ZV_PLUGIN_HANDLED
  76. }
  77. if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
  78. client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
  79. return ZV_PLUGIN_HANDLED
  80. }
  81. if(value == 2) {
  82. zp_make_user_survivor(id)
  83. new name[64]
  84. get_user_name(id, name, 63)
  85. client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
  86. g_bought[id]++
  87. }
  88. else if(zp_has_round_started() == value) {
  89. zp_make_user_survivor(id)
  90. if(get_pcvar_num(cvar_show_bought)) {
  91. new name[64]
  92. get_user_name(id, name, 63)
  93. client_printcolor(0, "/g[ZP] %s /ybought survivor", name)
  94. g_bought[id]++
  95. bought = true
  96. }
  97. }
  98. else {
  99. client_printcolor(id, "/g[ZP] /yYou can buy Survivor only when %s.", value ? "round started":"round not started")
  100. return ZV_PLUGIN_HANDLED
  101. }
  102. }
  103. return 1
  104. }
  105.  
  106. stock client_printcolor(const id, const input[], any:...)
  107. {
  108. new iCount = 1, iPlayers[32]
  109.  
  110. static szMsg[191]
  111. vformat(szMsg, charsmax(szMsg), input, 3)
  112.  
  113. replace_all(szMsg, 190, "/g", "^4") // green txt
  114. replace_all(szMsg, 190, "/y", "^1") // orange txt
  115. replace_all(szMsg, 190, "/ctr", "^3") // team txt
  116. replace_all(szMsg, 190, "/w", "^0") // team txt
  117.  
  118. if(id) iPlayers[0] = id
  119. else get_players(iPlayers, iCount, "ch")
  120.  
  121. for (new i = 0; i < iCount; i++)
  122. {
  123. if (is_user_connected(iPlayers[i]))
  124. {
  125. message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
  126. write_byte(iPlayers[i])
  127. write_string(szMsg)
  128. message_end()
  129. }
  130. }
  131. }
  132.  

Szerző:  kiki [ 2013.07.19. 10:30 ]
Hozzászólás témája:  Re: Item limit?

Mellesleg csak egy cvart kell átírni:

zp_allow_times, most 4en van, tehát 4szer veheted meg, írd át 1re.

Oldal: 1 / 2 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/