hlmod.hu
https://hlmod.hu/

Ammochange
https://hlmod.hu/viewtopic.php?f=28&t=7639
Oldal: 1 / 1

Szerző:  makker17 [2013.03.09. 11:44 ]
Hozzászólás témája:  Ammochange

Hol is kell beállítani,hogy mennyi ammot kaptál az kisebb betűvel legyen?
Mert a mostani az nagyon nagy, kisebbre szeretném venni, pocízió maradhat ugyanott csak a betűméreten kéne változtatni!
Előre is köszönöm!
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <zombieplague>
  5. #include <dhudmessage>
  6.  
  7. new ammo[3][33],string[21],cvarShowType,ammopacks
  8.  
  9. public plugin_init() {
  10. register_plugin("[ZP] AmmoChange", "1.0", "ZETA [M|E|N]")
  11. register_logevent("round_start", 2, "1=Round_Start")
  12. cvarShowType = register_cvar("ac_show_type", "1")
  13.  
  14. register_clcmd("say /change","func_change",ADMIN_ALL,"")
  15. }
  16.  
  17. public round_start() {
  18. new players[32],num,i
  19. get_players(players,num)
  20.  
  21. for(i=1;i<num;i++) {
  22. ammo[0][players[i]] = zp_get_user_ammo_packs(players[i])
  23. }
  24. }
  25.  
  26. public client_putinserver(id) {
  27. set_task(3.0,"func_ammo",id)
  28. }
  29.  
  30. public func_ammo(id) {
  31. ammopacks = zp_get_user_ammo_packs(id)
  32.  
  33. ammo[0][id] = ammopacks
  34. ammo[1][id] = ammopacks
  35. ammo[2][id] = ammopacks
  36.  
  37. set_task(1.0,"change_ammo",id,_,_,"b")
  38. }
  39.  
  40. public change_ammo(id) {
  41. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  42. return PLUGIN_HANDLED
  43.  
  44. ammo[1][id] = zp_get_user_ammo_packs(id)
  45.  
  46. if(ammo[1][id] != ammo[2][id]) {
  47. if(ammo[1][id] > ammo[2][id]) {
  48. ammopacks = ammo[1][id] - ammo[2][id]
  49. format(string,charsmax(string),"[ +%d Lőszer Csomag ]", ammopacks)
  50. }
  51. else {
  52. ammopacks = ammo[2][id] - ammo[1][id]
  53. format(string,charsmax(string),"[ -%d Lőszer Csomag ]", ammopacks)
  54. }
  55.  
  56. ammo[2][id] = ammo[1][id]
  57.  
  58. if(get_pcvar_num(cvarShowType)) {
  59. set_dhudmessage(255, 255, 255, -1.0, 0.37, 0, 0.1, 2.0,_,_,3)
  60. show_dhudmessage(id, "%s", string)
  61. }
  62. else
  63. client_print(id, print_center, "%s", string)
  64. }
  65.  
  66. return PLUGIN_HANDLED
  67. }
  68.  
  69. public client_disconnect(id) {
  70. ammo[0][id] = 0
  71. ammo[1][id] = 0
  72. ammo[2][id] = 0
  73.  
  74. remove_task(id)
  75. }
  76.  
  77. public func_change(id) {
  78. if(ammo[0][id] != ammo[2][id]) {
  79. if(ammo[0][id] > ammo[2][id]) {
  80. ammopacks = ammo[0][id] - ammo[2][id]
  81. client_print(id,print_chat,"", ammopacks)
  82. }
  83. else {
  84. ammopacks = ammo[2][id] - ammo[0][id]
  85. client_print(id,print_chat,"", ammopacks)
  86. }
  87. }
  88. else
  89. client_print(id,print_chat,"")
  90. return PLUGIN_HANDLED
  91. }
  92.  

Szerző:  IrOn [2013.03.09. 12:09 ]
Hozzászólás témája:  Re: Ammochange

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <zombieplague>
  5.  
  6. new ammo[3][33],string[21],cvarShowType,ammopacks
  7.  
  8. public plugin_init() {
  9. register_plugin("[ZP] AmmoChange", "1.0", "ZETA [M|E|N]")
  10. register_logevent("round_start", 2, "1=Round_Start")
  11. cvarShowType = register_cvar("ac_show_type", "1")
  12.  
  13. register_clcmd("say /change","func_change",ADMIN_ALL,"")
  14. }
  15.  
  16. public round_start() {
  17. new players[32],num,i
  18. get_players(players,num)
  19.  
  20. for(i=1;i<num;i++) {
  21. ammo[0][players[i]] = zp_get_user_ammo_packs(players[i])
  22. }
  23. }
  24.  
  25. public client_putinserver(id) {
  26. set_task(3.0,"func_ammo",id)
  27. }
  28.  
  29. public func_ammo(id) {
  30. ammopacks = zp_get_user_ammo_packs(id)
  31.  
  32. ammo[0][id] = ammopacks
  33. ammo[1][id] = ammopacks
  34. ammo[2][id] = ammopacks
  35.  
  36. set_task(1.0,"change_ammo",id,_,_,"b")
  37. }
  38.  
  39. public change_ammo(id) {
  40. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  41. return PLUGIN_HANDLED
  42.  
  43. ammo[1][id] = zp_get_user_ammo_packs(id)
  44.  
  45. if(ammo[1][id] != ammo[2][id]) {
  46. if(ammo[1][id] > ammo[2][id]) {
  47. ammopacks = ammo[1][id] - ammo[2][id]
  48. format(string,charsmax(string),"[ +%d Lőszer Csomag ]", ammopacks)
  49. }
  50. else {
  51. ammopacks = ammo[2][id] - ammo[1][id]
  52. format(string,charsmax(string),"[ -%d Lőszer Csomag ]", ammopacks)
  53. }
  54.  
  55. ammo[2][id] = ammo[1][id]
  56.  
  57. if(get_pcvar_num(cvarShowType)) {
  58. set_hudmessage(255, 255, 255, -1.0, 0.37, 0, 0.1, 2.0,_,_,3)
  59. show_hudmessage(id, "%s", string)
  60. }
  61. else
  62. client_print(id, print_center, "%s", string)
  63. }
  64.  
  65. return PLUGIN_HANDLED
  66. }
  67.  
  68. public client_disconnect(id) {
  69. ammo[0][id] = 0
  70. ammo[1][id] = 0
  71. ammo[2][id] = 0
  72.  
  73. remove_task(id)
  74. }
  75.  
  76. public func_change(id) {
  77. if(ammo[0][id] != ammo[2][id]) {
  78. if(ammo[0][id] > ammo[2][id]) {
  79. ammopacks = ammo[0][id] - ammo[2][id]
  80. client_print(id,print_chat,"", ammopacks)
  81. }
  82. else {
  83. ammopacks = ammo[2][id] - ammo[0][id]
  84. client_print(id,print_chat,"", ammopacks)
  85. }
  86. }
  87. else
  88. client_print(id,print_chat,"")
  89. return PLUGIN_HANDLED
  90. }

Szerző:  makker17 [2013.03.09. 14:47 ]
Hozzászólás témája:  Re: Ammochange

Nagyon szépen köszönöm, megtudhatom melyik sort írtad át?

Szerző:  small [2013.03.09. 14:51 ]
Hozzászólás témája:  Re: Ammochange

Kód:
#include <dhudmessage>

Ezt kitörölte...


Kód:
set_dhudmessage(255, 255, 255, -1.0, 0.37, 0, 0.1, 2.0,_,_,3)
show_dhudmessage(id, "%s", string)

-->
Kód:
set_hudmessage(255, 255, 255, -1.0, 0.37, 0, 0.1, 2.0,_,_,3)
show_hudmessage(id, "%s", string)

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