hlmod.hu
https://hlmod.hu/

ini be mentés(oles,kredit)
https://hlmod.hu/viewtopic.php?f=29&t=21482
Oldal: 1 / 1

Szerző:  krisztian2 [2015.07.14. 12:32 ]
Hozzászólás témája:  ini be mentés(oles,kredit)

Hellósztok olyan kéne hogy ini be mentse az öléseket,krediteket
NEGATÍV kommenteket nem kérek köszönöm.
ide kéne menteni addons/amxmodx/configs/mentes.ini
aki ír egy példát repül a pacsi.

Szerző:  SmaCk [2015.07.14. 12:34 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

krisztian2 írta:
Hellósztok olyan kéne hogy ini be mentse az öléseket,krediteket
NEGATÍV kommenteket nem kérek köszönöm.
ide kéne menteni addons/amxmodx/configs/mentes.ini
aki ír egy példát repül a pacsi.


De milyen pluginról van szó?
Mármint Skinrendszer, vagy mi? ("az alapja")

Szerző:  krisztian2 [2015.07.14. 12:40 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

Igen, csomagos skin rendszer oléseket,krediteket kéne elmenteni ini be

Szerző:  DecToR [2015.07.14. 12:43 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

létrehozol a configs-ba egy "mentes" mappát és oda menti a felcsatlakozott játékosokat meg elmenti a kreditet meg az öléseit.


Forráskód:
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #define PLUGIN "New Plug-In"
  7. #define VERSION "1.0"
  8. #define AUTHOR "DecToR"
  9.  
  10. new oles[33]
  11. new kredit[33]
  12.  
  13. public plugin_init() {
  14. register_plugin(PLUGIN, VERSION, AUTHOR)
  15.  
  16. // Add your code here...
  17. }
  18. public client_connect(id)
  19. {
  20. betoltes(id)
  21. oles[id] = 0;
  22. kredit[id] = 0;
  23. }
  24. public client_disconnect(id)
  25. {
  26. mentes(id)
  27. }
  28. public mentes(id) {
  29. if(is_user_connected(id))
  30. {
  31. new file[192], nm[32], mentes[512]
  32. get_user_name(id, nm, 31)
  33. replace_all(nm, 31, "/", "_")
  34. replace_all(nm, 31, "?", "_")
  35. replace_all(nm, 31, "!", "_")
  36. replace_all(nm, 31, "*", "_")
  37. replace_all(nm, 31, "#", "_")
  38. replace_all(nm, 31, "=", "_")
  39. replace_all(nm, 31, "-", "_")
  40. replace_all(nm, 31, "+", "_")
  41. replace_all(nm, 31, ",", "_")
  42. replace_all(nm, 31, "@", "_")
  43. replace_all(nm, 31, "&", "_")
  44. replace_all(nm, 31, "{", "_")
  45. replace_all(nm, 31, "}", "_")
  46. replace_all(nm, 31, "~", "_")
  47. replace_all(nm, 31, ":", "_")
  48. replace_all(nm, 31, ".", "_")
  49. replace_all(nm, 31, "<", "_")
  50. replace_all(nm, 31, ">", "_")
  51. replace_all(nm, 31, "|", "_")
  52. formatex(file, charsmax(file), "addons/amxmodx/configs/mentes/%s.ini", nm)
  53. delete_file(file)
  54. format(mentes, charsmax(mentes), "%d %d ", oles[id], kredit[id])
  55. write_file(file, mentes)
  56. }
  57. }
  58. public betoltes(id)
  59. {
  60. if(is_user_connected(id))
  61. {
  62. new file[192], nm[32]
  63. get_user_name(id, nm, 31)
  64. replace_all(nm, 31, "/", "_")
  65. replace_all(nm, 31, "?", "_")
  66. replace_all(nm, 31, "!", "_")
  67. replace_all(nm, 31, "*", "_")
  68. replace_all(nm, 31, "#", "_")
  69. replace_all(nm, 31, "=", "_")
  70. replace_all(nm, 31, "-", "_")
  71. replace_all(nm, 31, "+", "_")
  72. replace_all(nm, 31, ",", "_")
  73. replace_all(nm, 31, "@", "_")
  74. replace_all(nm, 31, "&", "_")
  75. replace_all(nm, 31, "{", "_")
  76. replace_all(nm, 31, "}", "_")
  77. replace_all(nm, 31, "~", "_")
  78. replace_all(nm, 31, ":", "_")
  79. replace_all(nm, 31, ".", "_")
  80. replace_all(nm, 31, "<", "_")
  81. replace_all(nm, 31, ">", "_")
  82. replace_all(nm, 31, "|", "_")
  83. formatex(file, charsmax(file), "addons/amxmodx/configs/mentes/%s.ini", nm)
  84. new file_pointer = fopen(file, "r")
  85. if(!file_pointer)
  86. {
  87. write_file(file, "0 0")
  88. return PLUGIN_HANDLED
  89. }
  90. fclose(file_pointer)
  91. new lines = file_size(file, 1)
  92. new a1[32], a2[32]
  93. if(lines > 0)
  94. {
  95. new buff[512], len
  96. read_file(file, lines=0, buff, charsmax(buff), len)
  97. parse(buff, a1, 31, a2, 31)
  98. oles[id] = str_to_num(a1)
  99. kredit[id] = str_to_num(a2)
  100.  
  101.  
  102. }
  103. }
  104. return PLUGIN_HANDLED
  105. }

Szerző:  krisztian2 [2015.07.14. 12:48 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

Amikor webadminbol resizem a szervert eltünik minden :(

Szerző:  DecToR [2015.07.14. 12:57 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

krisztian2 írta:
Amikor webadminbol resizem a szervert eltünik minden :(


létrehoztad a mappát?

ja és mapot válts.

Szerző:  krisztian2 [2015.07.14. 13:02 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

igen,mindent
de üres az a mappa ahányszor megnézem.

Szerző:  DecToR [2015.07.14. 16:39 ]
Hozzászólás témája:  Re: ini be mentés(oles,kredit)

krisztian2 írta:
igen,mindent
de üres az a mappa ahányszor megnézem.


mostmár jó :)

SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5.  
  6. #define PLUGIN "New Plug-In"
  7. #define VERSION "1.0"
  8. #define AUTHOR "DecToR"
  9.  
  10. new oles[33]
  11. new kredit[33]
  12.  
  13. public plugin_init() {
  14. register_plugin(PLUGIN, VERSION, AUTHOR)
  15.  
  16. // Add your code here...
  17. }
  18. public client_putinserver(id)
  19. {
  20. betoltes(id)
  21. }
  22. public client_connect(id)
  23. {
  24. betoltes(id)
  25. oles[id] = 0;
  26. kredit[id] = 0;
  27. }
  28. public client_disconnect(id)
  29. {
  30. mentes(id)
  31. }
  32. public mentes(id) {
  33. if(is_user_connected(id))
  34. {
  35. new file[192], nm[32], mentes[512]
  36. get_user_name(id, nm, 31)
  37. replace_all(nm, 31, "/", "_")
  38. replace_all(nm, 31, "?", "_")
  39. replace_all(nm, 31, "!", "_")
  40. replace_all(nm, 31, "*", "_")
  41. replace_all(nm, 31, "#", "_")
  42. replace_all(nm, 31, "=", "_")
  43. replace_all(nm, 31, "-", "_")
  44. replace_all(nm, 31, "+", "_")
  45. replace_all(nm, 31, ",", "_")
  46. replace_all(nm, 31, "@", "_")
  47. replace_all(nm, 31, "&", "_")
  48. replace_all(nm, 31, "{", "_")
  49. replace_all(nm, 31, "}", "_")
  50. replace_all(nm, 31, "~", "_")
  51. replace_all(nm, 31, ":", "_")
  52. replace_all(nm, 31, ".", "_")
  53. replace_all(nm, 31, "<", "_")
  54. replace_all(nm, 31, ">", "_")
  55. replace_all(nm, 31, "|", "_")
  56. formatex(file, charsmax(file), "addons/amxmodx/configs/mentes/%s.ini", nm)
  57. delete_file(file)
  58. format(mentes, charsmax(mentes), "%d %d ", oles[id], kredit[id])
  59. write_file(file, mentes)
  60. }
  61. }
  62. public betoltes(id)
  63. {
  64. if(is_user_connected(id))
  65. {
  66. new file[192], nm[32]
  67. get_user_name(id, nm, 31)
  68. replace_all(nm, 31, "/", "_")
  69. replace_all(nm, 31, "?", "_")
  70. replace_all(nm, 31, "!", "_")
  71. replace_all(nm, 31, "*", "_")
  72. replace_all(nm, 31, "#", "_")
  73. replace_all(nm, 31, "=", "_")
  74. replace_all(nm, 31, "-", "_")
  75. replace_all(nm, 31, "+", "_")
  76. replace_all(nm, 31, ",", "_")
  77. replace_all(nm, 31, "@", "_")
  78. replace_all(nm, 31, "&", "_")
  79. replace_all(nm, 31, "{", "_")
  80. replace_all(nm, 31, "}", "_")
  81. replace_all(nm, 31, "~", "_")
  82. replace_all(nm, 31, ":", "_")
  83. replace_all(nm, 31, ".", "_")
  84. replace_all(nm, 31, "<", "_")
  85. replace_all(nm, 31, ">", "_")
  86. replace_all(nm, 31, "|", "_")
  87. formatex(file, charsmax(file), "addons/amxmodx/configs/mentes/%s.ini", nm)
  88. new file_pointer = fopen(file, "r")
  89. if(!file_pointer)
  90. {
  91. write_file(file, "0 0")
  92. return PLUGIN_HANDLED
  93. }
  94. fclose(file_pointer)
  95. new lines = file_size(file, 1)
  96. new a1[32], a2[32]
  97. if(lines > 0)
  98. {
  99. new buff[512], len
  100. read_file(file, lines=0, buff, charsmax(buff), len)
  101. parse(buff, a1, 31, a2, 31)
  102. oles[id] = str_to_num(a1)
  103. kredit[id] = str_to_num(a2)
  104.  
  105.  
  106. }
  107. }
  108. return PLUGIN_HANDLED
  109. }

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