hlmod.hu
https://hlmod.hu/

Loginba bejelentkezés Logolása.
https://hlmod.hu/viewtopic.php?f=18&t=22156
Oldal: 1 / 1

Szerző:  DecToR [2015.09.08. 18:02 ]
Hozzászólás témája:  Loginba bejelentkezés Logolása.

Szevasztok! azt miért nem írja ki a log-okban hogy PL: "NÉV" belépett ezzel a Loginnal az adminjába: amx_login "xy" "xy" ?

Szóval azt hogy birom megcsinálni hogy ezeket is logolja? vagy esetleg Pluginnal meglehet oldani? PL: hogy .txt-be mentse azt hogy melyik név loginolt , és melyik loginnal?:)

előre is köszönöm.

DecToR

Szerző:  mforce [2015.09.08. 18:14 ]
Hozzászólás témája:  Re: Loginba bejelentkezés Logolása.

Próba:
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define max_admins 64
  5.  
  6. public login(id)
  7. {
  8. new usercfg[64]
  9. new arguser[32], argpass[32], username[32], password[32]
  10. new line = 0
  11. new flags
  12. new strflags[32]
  13. new linetext[255], linetextlength
  14.  
  15. read_argv(1,arguser,31)
  16. read_argv(2,argpass,31)
  17.  
  18. if((arguser[0] > 0)&&(argpass[0] > 0))
  19. {
  20. get_customdir(usercfg, 63)
  21. format(usercfg, 63, "%s/amx_login/loginusers.ini", usercfg)
  22.  
  23. if (file_exists(usercfg))
  24. {
  25. while ((line = read_file(usercfg, line, linetext, 256, linetextlength)))
  26. {
  27. if(linetext[0] == ';')
  28. {
  29. continue
  30. }
  31. parse(linetext, username, 31, password, 31, strflags, 31)
  32. flags = read_flags(strflags)
  33.  
  34. if((equal(username, arguser))&&(equal(password, argpass)))
  35. {
  36. set_user_flags(id, flags)
  37. new text[128]
  38. format(text, 128, "[AMXX AUTH] You are now logged in, with the flags: %s.", strflags)
  39. client_print(id, print_console, text)
  40. new datum[32], adat[3][32]
  41. get_user_name(id, adat[0], charsmax(adat));
  42. get_user_authid(id, adat[1], charsmax(adat));
  43. get_user_ip(id, adat[2], charsmax(adat), 1);
  44. get_time( "%Y_%m_%d", datum, charsmax(datum));
  45. log_to_file( "admin_belepesek/%s.log", "%s belépett! Név: %s SteamID: %s IP: %s", datum, arguser, adat[0], adat[1], adat[2]);
  46.  
  47. return PLUGIN_HANDLED
  48. }
  49. }
  50. client_print(id, print_console, "[AMXX AUTH] Incorrect username and/or password.")
  51. }
  52. }
  53. return PLUGIN_HANDLED
  54. }
  55. public logout(id)
  56. {
  57. remove_user_flags(id, -1)
  58. client_print(id, print_console, "[AMXX AUTH] You are now logged out of administrator status")
  59. return PLUGIN_HANDLED
  60. }
  61. public plugin_init()
  62. {
  63. register_plugin("Admin Login","1.0","James Romeril")
  64. register_clcmd("amx_login","login",-1,"amx_login <username> <password> - Logs a player in as admin")
  65. register_clcmd("amx_logout","logout",-1,"amx_logout - Logs a player out of admin")
  66. }

Szerző:  DecToR [2015.09.08. 20:28 ]
Hozzászólás témája:  Re: Loginba bejelentkezés Logolása.

Nem logolja :(

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