hlmod.hu
https://hlmod.hu/

resetscore
https://hlmod.hu/viewtopic.php?f=29&t=6829
Oldal: 1 / 1

Szerző:  zolee007 [ 2012.12.13. 22:02 ]
Hozzászólás témája:  resetscore

Valaki meg tudja csinálni hogy ha be írom /rs akkor vissza adja a kezdő pénzt

Szerző:  small [ 2012.12.13. 23:18 ]
Hozzászólás témája:  Re: resetscore

Milyen kezdő pénzt?

Szerző:  zolee007 [ 2012.12.13. 23:55 ]
Hozzászólás témája:  Re: resetscore

hát pl 16k a kezdő akkor be írom hogy /rs és vissza kapom a pénzt

Szerző:  small [ 2012.12.14. 13:20 ]
Hozzászólás témája:  Re: resetscore

SMA Forráskód: [ Mindet kijelol ]
  1.  
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <cstrike>
  6. #include <fun>
  7.  
  8. #define adtime 600.0 //Default of 10 minuites
  9.  
  10. new pcvar_Advertise
  11. new pcvar_Display
  12. new Penz
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin("Reset Score", "1.0", "Silenttt")
  17.  
  18.  
  19. penz = register_cvar("Penz","16000")
  20. register_clcmd("say /resetscore", "reset_score")
  21. register_clcmd("say /rs", "reset_score")
  22.  
  23.  
  24. pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
  25. pcvar_Display = register_cvar("sv_rsdisplay", "0")
  26.  
  27. if(get_cvar_num("sv_rsadvertise") == 1)
  28. {
  29. set_task(adtime, "advertise", _, _, _, "b")
  30. }
  31. }
  32.  
  33. public reset_score(id)
  34. {
  35. cs_set_user_money(id,get_pcvar_num(penz))
  36. {
  37. client_print(id,print_chat,"[Reset Score] Kaptal 16000$")
  38. }
  39.  
  40. cs_set_user_deaths(id, 0)
  41. set_user_frags(id, 0)
  42. cs_set_user_deaths(id, 0)
  43. set_user_frags(id, 0)
  44.  
  45. if(get_pcvar_num(pcvar_Display) == 1)
  46. {
  47. new name[33]
  48. get_user_name(id, name, 32)
  49. client_print(0, print_chat, "%s nullazta a statjat.", name)
  50. }
  51. else
  52. {
  53. client_print(id, print_chat, "A statod sikeresen lenullazva!")
  54. }
  55. }
  56.  
  57. public advertise()
  58. {
  59. set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
  60. show_hudmessage(0, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz")
  61. }
  62.  
  63. public client_putinserver(id)
  64. {
  65. if(get_pcvar_num(pcvar_Advertise) == 1)
  66. {
  67. set_task(10.0, "connectmessage", id, _, _, "a", 1)
  68. }
  69. }
  70.  
  71. public connectmessage(id)
  72. {
  73. if(is_user_connected(id))
  74. {
  75. client_print(id, print_chat, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz (nem kell reconnectelned)")
  76. }
  77. }
  78.  


Cvaral tudod állítani...

Szerző:  HunGamer [ 2012.12.14. 13:30 ]
Hozzászólás témája:  Re: resetscore

Inkább így:
[ablak]
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fun>
  5.  
  6. #define adtime 600.0 //Default of 10 minuites
  7.  
  8. new pcvar_Advertise
  9. new pcvar_Display
  10. new money
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin("Reset Score", "1.0", "Silenttt")
  15.  
  16.  
  17. register_clcmd("say /resetscore", "reset_score")
  18. register_clcmd("say /rs", "reset_score")
  19.  
  20.  
  21. pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
  22. pcvar_Display = register_cvar("sv_rsdisplay", "0")
  23.  
  24. if(get_cvar_num("sv_rsadvertise") == 1)
  25. {
  26. set_task(adtime, "advertise", _, _, _, "b")
  27. }
  28. money = get_cvar_num("mp_startmoney")
  29. }
  30.  
  31. public reset_score(id)
  32. {
  33. cs_set_user_deaths(id, 0)
  34. set_user_frags(id, 0)
  35. cs_set_user_deaths(id, 0)
  36. set_user_frags(id, 0)
  37.  
  38. if(get_pcvar_num(pcvar_Display) == 1)
  39. {
  40. new name[33]
  41. get_user_name(id, name, 32)
  42. client_print(0, print_chat, "%s nullazta a statjat.", name)
  43. }
  44. else
  45. {
  46. client_print(id, print_chat, "A statod sikeresen lenullazva!")
  47. }
  48. cs_set_user_money(id, money)
  49. }
  50.  
  51. public advertise()
  52. {
  53. set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
  54. show_hudmessage(0, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz")
  55. }
  56.  
  57. public client_putinserver(id)
  58. {
  59. if(get_pcvar_num(pcvar_Advertise) == 1)
  60. {
  61. set_task(10.0, "connectmessage", id, _, _, "a", 1)
  62. }
  63. }
  64.  
  65. public connectmessage(id)
  66. {
  67. if(is_user_connected(id))
  68. {
  69. client_print(id, print_chat, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz (nem kell reconnectelned)")
  70. }
  71. }
  72.  
[/ablak]

Szerző:  Maxi [ 2012.12.28. 12:11 ]
Hozzászólás témája:  Re: resetscore

zolee007 írta:
Valaki meg tudja csinálni hogy ha be írom /rs akkor vissza adja a kezdő pénzt

TESS!!
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fun>
  5.  
  6. #define adtime 600.0 //Default of 10 minuites
  7.  
  8. new pcvar_Advertise
  9. new pcvar_Display
  10. new money
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin("Reset Score", "1.0", "Silenttt")
  15.  
  16.  
  17. register_clcmd("say /resetscore", "reset_score")
  18. register_clcmd("say /rs", "reset_score")
  19.  
  20.  
  21. pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
  22. pcvar_Display = register_cvar("sv_rsdisplay", "0")
  23.  
  24. if(get_cvar_num("sv_rsadvertise") == 1)
  25. {
  26. set_task(adtime, "advertise", _, _, _, "b")
  27. }
  28. money = get_cvar_num("mp_startmoney")
  29. }
  30.  
  31. public reset_score(id)
  32. {
  33. cs_set_user_deaths(id, 0)
  34. set_user_frags(id, 0)
  35. cs_set_user_deaths(id, 0)
  36. set_user_frags(id, 0)
  37.  
  38. if(get_pcvar_num(pcvar_Display) == 1)
  39. {
  40. new name[33]
  41. get_user_name(id, name, 32)
  42. client_print(0, print_chat, "%s nullazta a statjat.", name)
  43. }
  44. else
  45. {
  46. client_print(id, print_chat, "A statod sikeresen lenullazva!")
  47. }
  48. cs_set_user_money(id, money)
  49. }
  50.  
  51. public advertise()
  52. {
  53. set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
  54. show_hudmessage(0, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz")
  55. }
  56.  
  57. public client_putinserver(id)
  58. {
  59. if(get_pcvar_num(pcvar_Advertise) == 1)
  60. {
  61. set_task(10.0, "connectmessage", id, _, _, "a", 1)
  62. }
  63. }
  64.  
  65. public connectmessage(id)
  66. {
  67. if(is_user_connected(id))
  68. {
  69. client_print(id, print_chat, "Ird be chatbe, hogy /rs a statod nullazasahoz (nem kell ujracsatiznod)")
  70. }
  71. }

Szerző:  kiki [ 2012.12.28. 13:33 ]
Hozzászólás témája:  Re: resetscore

maxi írta:
zolee007 írta:
Valaki meg tudja csinálni hogy ha be írom /rs akkor vissza adja a kezdő pénzt

TESS!!
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <fun>
  5.  
  6. #define adtime 600.0 //Default of 10 minuites
  7.  
  8. new pcvar_Advertise
  9. new pcvar_Display
  10. new money
  11.  
  12. public plugin_init()
  13. {
  14. register_plugin("Reset Score", "1.0", "Silenttt")
  15.  
  16.  
  17. register_clcmd("say /resetscore", "reset_score")
  18. register_clcmd("say /rs", "reset_score")
  19.  
  20.  
  21. pcvar_Advertise = register_cvar("sv_rsadvertise", "0")
  22. pcvar_Display = register_cvar("sv_rsdisplay", "0")
  23.  
  24. if(get_cvar_num("sv_rsadvertise") == 1)
  25. {
  26. set_task(adtime, "advertise", _, _, _, "b")
  27. }
  28. money = get_cvar_num("mp_startmoney")
  29. }
  30.  
  31. public reset_score(id)
  32. {
  33. cs_set_user_deaths(id, 0)
  34. set_user_frags(id, 0)
  35. cs_set_user_deaths(id, 0)
  36. set_user_frags(id, 0)
  37.  
  38. if(get_pcvar_num(pcvar_Display) == 1)
  39. {
  40. new name[33]
  41. get_user_name(id, name, 32)
  42. client_print(0, print_chat, "%s nullazta a statjat.", name)
  43. }
  44. else
  45. {
  46. client_print(id, print_chat, "A statod sikeresen lenullazva!")
  47. }
  48. cs_set_user_money(id, money)
  49. }
  50.  
  51. public advertise()
  52. {
  53. set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
  54. show_hudmessage(0, "Csak ird be chatbe, hogy /resetscore vagy /rs a statod nullazasahoz")
  55. }
  56.  
  57. public client_putinserver(id)
  58. {
  59. if(get_pcvar_num(pcvar_Advertise) == 1)
  60. {
  61. set_task(10.0, "connectmessage", id, _, _, "a", 1)
  62. }
  63. }
  64.  
  65. public connectmessage(id)
  66. {
  67. if(is_user_connected(id))
  68. {
  69. client_print(id, print_chat, "Ird be chatbe, hogy /rs a statod nullazasahoz (nem kell ujracsatiznod)")
  70. }
  71. }


Kedves maxi ebbe hol adja a pénzt?:D Ez egy sima pontnullázás. Na nézzük mit alkottok, megsúgom alap cvar értékének lekéréséhez használjátok a get_cvar_pointer funkciót. Tehát:

new startmoney = get_cvar_pointer("mp_startmoney")

Szerző:  HunGamer [ 2012.12.28. 14:36 ]
Hozzászólás témája:  Re: resetscore

Ugyanazt írta ki amit előtte 2 héttel én.. Amugy le van kérve a startmoney + benne van a pénz adás xd

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