HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <orpheu_memory>
  4.  
  5. new fajlhelye[256]
  6.  
  7. public plugin_init()
  8. {
  9. register_plugin("Slot Valto", "1.0", "Kiki33 & Metal")
  10. set_task(240.0, "pluginhirdetes", _, _, _, "b" )
  11. }
  12.  
  13. public plugin_precache()
  14. {
  15. if(is_module_loaded("orpheu"))
  16. {
  17.  
  18. get_configsdir(fajlhelye, 255);
  19. format(fajlhelye, 255, "%s/orpheu/memory/KIKI33", fajlhelye);
  20. falj_keszites();
  21. OrpheuMemoryReplace("KIKI33",0,"-maxplayers", "%d", random_num(10000000000, 90000000000))
  22. server_cmd("maxplayers 32") //Itt tudod beállítani hány slotos legyen a szerver.
  23. }
  24. else
  25. {
  26. log_to_file("slot.kiki", "SAJNALOM, A PLUGIN FUTTATASHOZ ORPHEU KELL!")
  27. }
  28. }
  29.  
  30. public falj_keszites()
  31. {
  32. if(!file_exists(fajlhelye))
  33. {
  34. write_file(fajlhelye, "{")
  35. write_file(fajlhelye, " ^"name^" : ^"KIKI33^",")
  36. write_file(fajlhelye, " ^"library^" : ^"engine^",")
  37. write_file(fajlhelye, " ^"type^" : ^"string^",")
  38. write_file(fajlhelye, " ^"memoryType^" : ^"data^"")
  39. write_file(fajlhelye, "}")
  40. }
  41. }
  42.  
  43. public pluginhirdetes()
  44. {
  45. print_color(0, "!gA szerveren slot atiro plugin fut, melyet kiki keszitett! Info: www.hlmod.hu")
  46. }
  47.  
  48. stock print_color(const id, const input[], any:...)
  49. {
  50. new count = 1, players[32]
  51. static msg[191]
  52. vformat(msg, 190, input, 3)
  53.  
  54. replace_all(msg, 190, "!g", "^4")
  55. replace_all(msg, 190, "!y", "^1")
  56. replace_all(msg, 190, "!t", "^3")
  57.  
  58. if (id) players[0] = id; else get_players(players, count, "ch")
  59. {
  60. for (new i = 0; i < count; i++)
  61. {
  62. if (is_user_connected(players[i]))
  63. {
  64. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  65. write_byte(players[i])
  66. write_string(msg)
  67. message_end()
  68. }
  69. }
  70. }
  71. return PLUGIN_HANDLED
  72. }
  73.  
  74. //configs/oprheu/memory/KIKI33
  75.  
  76. // {
  77. // "name" : "KIKI33",
  78. // "library" : "engine",
  79. // "type" : "string",
  80. // "memoryType" : "data"
  81. // }
  82.