hlmod.hu
https://hlmod.hu/

LCS küldés
https://hlmod.hu/viewtopic.php?f=10&t=11321
Oldal: 1 / 1

Szerző:  ChaspeR [ 2013.10.15. 13:45 ]
Hozzászólás témája:  LCS küldés

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <zombieplague>
  4.  
  5. #define PLUGIN "[ZP] Loszercsomag kuldes"
  6. #define VERSION "1.1"
  7. #define AUTHOR "unnamed"
  8.  
  9. new g_UserTotalAmmo[33]
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13.  
  14. register_clcmd("say", "handleSay")
  15. register_clcmd("say_team", "handleSay")
  16.  
  17. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  18.  
  19.  
  20. }
  21.  
  22. public handleSay(id)
  23. {
  24. new args[64]
  25.  
  26. read_args(args, charsmax(args))
  27. remove_quotes(args)
  28.  
  29. new arg1[16]
  30. new arg2[32]
  31.  
  32. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  33. if (equal(arg1,"/kuldes", 7) || equal(arg1, "kuldes",6))
  34.  
  35. donate(id, arg2)
  36. }
  37.  
  38. public donate(id, arg[])
  39. {
  40. new to[32], count[10]
  41. strbreak(arg, to, 31, count, 9)
  42.  
  43. if (!to[0] || !count[0])
  44. {
  45. //client_printcolor(id, "!g[ZP] !yHasznalat: ird chatbe /kuldes <name> <loszercsomag>")
  46. return
  47. }
  48. new ammo_sender = zp_get_user_ammo_packs(id)
  49. new ammo
  50. if (equal(count, "all"))
  51. ammo = ammo_sender
  52. else
  53. ammo = str_to_num(count)
  54. if (ammo <= 0)
  55. {
  56. //client_printcolor(id, "!g[ZP] !yHibas loszercsomag szam!")
  57. return
  58. }
  59. ammo_sender -= ammo
  60. if (ammo_sender < 0)
  61. {
  62. ammo+=ammo_sender
  63. ammo_sender = 0
  64.  
  65. }
  66. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  67. if (!reciever || reciever == id)
  68. {
  69. //client_printcolor(id, "!g[Anonymus Zombie] !yJatekos !g%s !yNem talalhato meg a szerveren!", to)
  70. return
  71. }
  72.  
  73. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  74. g_UserTotalAmmo[reciever] += ammo
  75. zp_set_user_ammo_packs(id, ammo_sender)
  76. new aName[32], vName[32]
  77.  
  78. get_user_name(id, aName, 31)
  79. get_user_name(reciever, vName, 31)
  80.  
  81. }


Valaki kibírná nekem javítani azt a három client_printcolor részt valami mással ,hogy működjön 'SZÍNESEN' ??????

Szerző:  Super Nova [ 2013.10.15. 14:17 ]
Hozzászólás témája:  Re: LCS küldés

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <zombieplague>
  4. #include <colorchat>
  5. #define PLUGIN "[ZP] Loszercsomag kuldes"
  6. #define VERSION "1.1"
  7. #define AUTHOR "unnamed"
  8.  
  9. new g_UserTotalAmmo[33]
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13.  
  14. register_clcmd("say", "handleSay")
  15. register_clcmd("say_team", "handleSay")
  16.  
  17. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  18.  
  19.  
  20. }
  21.  
  22. public handleSay(id)
  23. {
  24. new args[64]
  25.  
  26. read_args(args, charsmax(args))
  27. remove_quotes(args)
  28.  
  29. new arg1[16]
  30. new arg2[32]
  31.  
  32. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  33. if (equal(arg1,"/kuldes", 7) || equal(arg1, "kuldes",6))
  34.  
  35. donate(id, arg2)
  36. }
  37.  
  38. public donate(id, arg[])
  39. {
  40. new to[32], count[10]
  41. strbreak(arg, to, 31, count, 9)
  42.  
  43. if (!to[0] || !count[0])
  44. {
  45. ColorChat(id,GREEN,"[ZP] ^x01 Hasznalat: ird chatbe /kuldes <name> <loszercsomag>")
  46. //client_printcolor(id, "!g[ZP] !yHasznalat: ird chatbe /kuldes <name> <loszercsomag>")
  47. return
  48. }
  49. new ammo_sender = zp_get_user_ammo_packs(id)
  50. new ammo
  51. if (equal(count, "all"))
  52. ammo = ammo_sender
  53. else
  54. ammo = str_to_num(count)
  55. if (ammo <= 0)
  56. {
  57. ColorChat(id,GREEN,"[ZP] ^x01Hibas loszercsomag szam!")
  58. //client_printcolor(id, "!g[ZP] !yHibas loszercsomag szam!")
  59. return
  60. }
  61. ammo_sender -= ammo
  62. if (ammo_sender < 0)
  63. {
  64. ammo+=ammo_sender
  65. ammo_sender = 0
  66.  
  67. }
  68. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  69. if (!reciever || reciever == id)
  70. {
  71. ColorChat(id,GREEN,"[Anonymus Zombie] ^x01Jatekos ^x04%s ^x01Nem talalhato meg a szerveren!")
  72. //client_printcolor(id, "!g[Anonymus Zombie] !yJatekos !g%s !yNem talalhato meg a szerveren!", to)
  73. return
  74. }
  75.  
  76. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  77. g_UserTotalAmmo[reciever] += ammo
  78. zp_set_user_ammo_packs(id, ammo_sender)
  79. new aName[32], vName[32]
  80.  
  81. get_user_name(id, aName, 31)
  82. get_user_name(reciever, vName, 31)
  83.  
  84. }

Szerző:  stupid [ 2013.10.15. 14:25 ]
Hozzászólás témája:  Re: LCS küldés

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <zombieplague>
  4. #include <printcolor>
  5.  
  6. #define PLUGIN "[ZP] Loszercsomag kuldes"
  7. #define VERSION "1.1"
  8. #define AUTHOR "unnamed"
  9.  
  10. new g_UserTotalAmmo[33]
  11.  
  12. public plugin_init() {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14.  
  15. register_clcmd("say", "handleSay")
  16. register_clcmd("say_team", "handleSay")
  17.  
  18. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  19.  
  20.  
  21. }
  22.  
  23. public handleSay(id)
  24. {
  25. new args[64]
  26.  
  27. read_args(args, charsmax(args))
  28. remove_quotes(args)
  29.  
  30. new arg1[16]
  31. new arg2[32]
  32.  
  33. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  34. if (equal(arg1,"/kuldes", 7) || equal(arg1, "kuldes",6))
  35.  
  36. donate(id, arg2)
  37. }
  38.  
  39. public donate(id, arg[])
  40. {
  41. new to[32], count[10]
  42. strbreak(arg, to, 31, count, 9)
  43.  
  44. if (!to[0] || !count[0])
  45. {
  46. print_color(index, "!g[ZP] !yHasznalat: ird chatbe /kuldes <name> <loszercsomag>")
  47. return
  48. }
  49. new ammo_sender = zp_get_user_ammo_packs(id)
  50. new ammo
  51. if (equal(count, "all"))
  52. ammo = ammo_sender
  53. else
  54. ammo = str_to_num(count)
  55. if (ammo <= 0)
  56. {
  57. print_color(index, "!g[ZP] !yHibas loszercsomag szam!")
  58. return
  59. }
  60. ammo_sender -= ammo
  61. if (ammo_sender < 0)
  62. {
  63. ammo+=ammo_sender
  64. ammo_sender = 0
  65.  
  66. }
  67. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  68. if (!reciever || reciever == id)
  69. {
  70. print_color(index, "!g[Anonymus Zombie] !yJatekos !g%s !yNem talalhato meg a szerveren!", to)
  71. return
  72. }
  73.  
  74. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  75. g_UserTotalAmmo[reciever] += ammo
  76. zp_set_user_ammo_packs(id, ammo_sender)
  77. new aName[32], vName[32]
  78.  
  79. get_user_name(id, aName, 31)
  80. get_user_name(reciever, vName, 31)
  81.  
  82. }
  83. stock print_color(const id, const input[], any:...)
  84. {
  85. new count = 1, players[32]
  86. static msg[191]
  87. vformat(msg, 190, input, 3)
  88.  
  89. replace_all(msg, 190, "!g", "^4")
  90. replace_all(msg, 190, "!y", "^1")
  91. replace_all(msg, 190, "!t", "^3")
  92. replace_all(msg, 190, "á", "á")
  93. replace_all(msg, 190, "é", "Ă©")
  94. replace_all(msg, 190, "í", "Ă­")
  95. replace_all(msg, 190, "ó", "Ăł")
  96. replace_all(msg, 190, "ö", "ö")
  97. replace_all(msg, 190, "ő", "Ĺ‘")
  98. replace_all(msg, 190, "ú", "Ăş")
  99. replace_all(msg, 190, "ü", "ĂĽ")
  100. replace_all(msg, 190, "ű", "ű")
  101. replace_all(msg, 190, "Á", "Á")
  102. replace_all(msg, 190, "É", "É")
  103. replace_all(msg, 190, "Í", "ĂŤ")
  104. replace_all(msg, 190, "Ó", "Ă“")
  105. replace_all(msg, 190, "Ö", "Ă–")
  106. replace_all(msg, 190, "Ő", "Ő")
  107. replace_all(msg, 190, "Ú", "Ăš")
  108. replace_all(msg, 190, "Ü", "Ăś")
  109. replace_all(msg, 190, "Ű", "Ĺ°")
  110.  
  111. if (id) players[0] = id; else get_players(players, count, "ch")
  112. {
  113. for (new i = 0; i < count; i++)
  114. {
  115. if (is_user_connected(players[i]))
  116. {
  117. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  118. write_byte(players[i])
  119. write_string(msg)
  120. message_end()
  121. }
  122. }
  123. }
  124. return PLUGIN_HANDLED
  125. }


+ printcolor include!

Csatolmányok:
printcolor.inc [1.72 KiB]
Letöltve 26 alkalommal.

Szerző:  Vinnice [ 2013.10.15. 18:45 ]
Hozzászólás témája:  Re: LCS küldés

Nem kell bele az inc, ha már benne van a stock.

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <zombieplague>
  4.  
  5. #define PLUGIN "[ZP] Loszercsomag kuldes"
  6. #define VERSION "1.1"
  7. #define AUTHOR "unnamed"
  8.  
  9. new g_UserTotalAmmo[33]
  10.  
  11. public plugin_init()
  12. {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14.  
  15. register_clcmd("say", "handleSay")
  16. register_clcmd("say_team", "handleSay")
  17.  
  18. register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
  19. }
  20.  
  21. public handleSay(id)
  22. {
  23. new args[64]
  24.  
  25. read_args(args, charsmax(args))
  26. remove_quotes(args)
  27.  
  28. new arg1[16]
  29. new arg2[32]
  30.  
  31. strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
  32. if (equal(arg1,"/kuldes", 7) || equal(arg1, "kuldes",6))
  33.  
  34. donate(id, arg2)
  35. }
  36.  
  37. public donate(id, arg[])
  38. {
  39. new to[32], count[10]
  40. strbreak(arg, to, 31, count, 9)
  41.  
  42. if (!to[0] || !count[0])
  43. {
  44. print_color(index, "!g[ZP] !yHasznalat: ird chatbe /kuldes <name> <loszercsomag>")
  45. return
  46. }
  47. new ammo_sender = zp_get_user_ammo_packs(id)
  48. new ammo
  49. if (equal(count, "all"))
  50. ammo = ammo_sender
  51. else
  52. ammo = str_to_num(count)
  53. if (ammo <= 0)
  54. {
  55. print_color(index, "!g[ZP] !yHibas loszercsomag szam!")
  56. return
  57. }
  58. ammo_sender -= ammo
  59. if (ammo_sender < 0)
  60. {
  61. ammo+=ammo_sender
  62. ammo_sender = 0
  63.  
  64. }
  65. new reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
  66. if (!reciever || reciever == id)
  67. {
  68. print_color(index, "!g[Anonymus Zombie] !yJatekos !g%s !yNem talalhato meg a szerveren!", to)
  69. return
  70. }
  71.  
  72. zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + ammo)
  73. g_UserTotalAmmo[reciever] += ammo
  74. zp_set_user_ammo_packs(id, ammo_sender)
  75. new aName[32], vName[32]
  76.  
  77. get_user_name(id, aName, 31)
  78. get_user_name(reciever, vName, 31)
  79.  
  80. }
  81.  
  82. stock print_color(const id, const input[], any:...)
  83. {
  84. new count = 1, players[32]
  85. static msg[191]
  86. vformat(msg, 190, input, 3)
  87.  
  88. replace_all(msg, 190, "!g", "^4")
  89. replace_all(msg, 190, "!y", "^1")
  90. replace_all(msg, 190, "!t", "^3")
  91. replace_all(msg, 190, "á", "á")
  92. replace_all(msg, 190, "é", "Ă©")
  93. replace_all(msg, 190, "í", "Ă­")
  94. replace_all(msg, 190, "ó", "Ăł")
  95. replace_all(msg, 190, "ö", "ö")
  96. replace_all(msg, 190, "ő", "Ĺ‘")
  97. replace_all(msg, 190, "ú", "Ăş")
  98. replace_all(msg, 190, "ü", "ĂĽ")
  99. replace_all(msg, 190, "ű", "ű")
  100. replace_all(msg, 190, "Á", "Á")
  101. replace_all(msg, 190, "É", "É")
  102. replace_all(msg, 190, "Í", "ĂŤ")
  103. replace_all(msg, 190, "Ó", "Ă“")
  104. replace_all(msg, 190, "Ö", "Ă–")
  105. replace_all(msg, 190, "Ő", "Ő")
  106. replace_all(msg, 190, "Ú", "Ăš")
  107. replace_all(msg, 190, "Ü", "Ăś")
  108. replace_all(msg, 190, "Ű", "Ĺ°")
  109.  
  110. if (id) players[0] = id; else get_players(players, count, "ch")
  111. {
  112. for (new i = 0; i < count; i++)
  113. {
  114. if (is_user_connected(players[i]))
  115. {
  116. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  117. write_byte(players[i])
  118. write_string(msg)
  119. message_end()
  120. }
  121. }
  122. }
  123. return PLUGIN_HANDLED
  124. }

Szerző:  Super Nova [ 2013.10.15. 20:36 ]
Hozzászólás témája:  Re: LCS küldés

De emberek...Ott van colorchattal,ami minden web átalakítónál alap inc...
Ne posztoljatok már 60 forrást...

Szerző:  stupid [ 2013.10.16. 16:31 ]
Hozzászólás témája:  Re: LCS küldés

Super Nova írta:
De emberek...Ott van colorchattal,ami minden web átalakítónál alap inc...
Ne posztoljatok már 60 forrást...

De te fogd már fel, amit kért azt tettük meg, nem kell túl ragozni colorchattel meg ilyenekkel.

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