hlmod.hu
https://hlmod.hu/

IP mentés
https://hlmod.hu/viewtopic.php?f=29&t=23810
Oldal: 1 / 1

Szerző:  theglorious [ 2016.02.01. 19:35 ]
Hozzászólás témája:  IP mentés

Sziasztok, olyan pluginra lenne szükségem ami menti az ip címeket, neveket .txt file ba!
[ablak]
Csatolmány:
asd.png
asd.png [ 6.92 KiB | Megtekintve 3867 alkalommal ]
[/ablak]
ezt ne :) IPLog

Szerző:  kiki [ 2016.02.01. 19:36 ]
Hozzászólás témája:  Re: IP mentés

Mikor mentse? Csatlakozáskor?

Up:

Mindenesetre itt van:

  1. public client_putinserver(id) {
  2.     new name[32], new ip[23]
  3.     get_user_name(id,name,31)
  4.     get_user_ip(id, ip, 22,1)
  5.  
  6. log_to_file("addons/amxmodx/logs/valami.txt", "Nev: %s | Ip: %s", nev, ip);
  7. }

Szerző:  kengurumancs [ 2016.02.01. 19:43 ]
Hozzászólás témája:  Re: IP mentés

Szia!
Tessék:
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Connect log"
  5. #define VERSION "1.0"
  6. #define AUTHOR "mforce"
  7.  
  8.  
  9. public plugin_init() {
  10.     register_plugin(PLUGIN, VERSION, AUTHOR)
  11. }
  12.  
  13. public client_putinserver(id) {
  14.     static adat[3][32];
  15.     get_user_name(id, adat[0], charsmax(adat));
  16.     get_user_authid(id, adat[1], charsmax(adat));
  17.     get_user_ip(id, adat[2], charsmax(adat), 1);
  18.     log_to_file( "csatlakozok.log", "%s csatlakozott | SteamID: %s | IP: %s", adat[0], adat[1], adat[2]);
  19. }

Szerző:  theglorious [ 2016.02.01. 20:19 ]
Hozzászólás témája:  Re: IP mentés

kengurumancs írta:
Szia!
Tessék:
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "Connect log"
  5. #define VERSION "1.0"
  6. #define AUTHOR "mforce"
  7.  
  8.  
  9. public plugin_init() {
  10.     register_plugin(PLUGIN, VERSION, AUTHOR)
  11. }
  12.  
  13. public client_putinserver(id) {
  14.     static adat[3][32];
  15.     get_user_name(id, adat[0], charsmax(adat));
  16.     get_user_authid(id, adat[1], charsmax(adat));
  17.     get_user_ip(id, adat[2], charsmax(adat), 1);
  18.     log_to_file( "csatlakozok.log", "%s csatlakozott | SteamID: %s | IP: %s", adat[0], adat[1], adat[2]);
  19. }

ez valahogy nem kóser :)
Kód:
L 02/01/2016 - 20:13:38: Nev: Pr | SteamID: ST | IP: 89
L 02/01/2016 - 20:16:02: Nev: Va | SteamID: VA | IP: 10
L 02/01/2016 - 20:16:32: Nev: RE | SteamID: ST | IP: 5.
L 02/01/2016 - 20:16:34: Nev: Va | SteamID: VA | IP: 10


kiki írta:
Mikor mentse? Csatlakozáskor?

Up:

Mindenesetre itt van:

  1. public client_putinserver(id) {
  2.     new name[32], new ip[23]
  3.     get_user_name(id,name,31)
  4.     get_user_ip(id, ip, 22,1)
  5.  
  6. log_to_file("addons/amxmodx/logs/valami.txt", "Nev: %s | Ip: %s", nev, ip);
  7. }

így működik is :)
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "iplog"
  5. #define VERSION "1.0"
  6. #define AUTHOR "kiki"
  7.  
  8.  
  9. public plugin_init() {
  10.     register_plugin(PLUGIN, VERSION, AUTHOR)
  11. }
  12.  
  13. public client_putinserver(id) {
  14.     new name[32]
  15.     new ip[23]
  16.     get_user_name(id,name,31)
  17.     get_user_ip(id, ip, 22,1)
  18.     log_to_file("addons/amxmodx/logs/ip_k.txt", "Nev: %s | Ip: %s", name, ip);
  19. }

Szerző:  Akosch:. [ 2016.02.01. 20:31 ]
Hozzászólás témája:  Re: IP mentés

  1. public client_putinserver(id) {
  2.     static adat[3][32];
  3.     get_user_name(id, adat[0], charsmax(adat[]));
  4.     get_user_authid(id, adat[1], charsmax(adat[]));
  5.     get_user_ip(id, adat[2], charsmax(adat[]), 1);
  6.     log_to_file( "csatlakozok.log", "%s csatlakozott | SteamID: %s | IP: %s", adat[0], adat[1], adat[2]);
  7. }

Így jó mforce verziója is, charsmax( adat ) helyett charsmax( adat[ ] ), így a második dimenzió "méretét" adja vissza. ( 3 helyett 32-t )

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