SA-MP Forums Archive
getting a ip from a offline player - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: getting a ip from a offline player (/showthread.php?tid=576652)



getting a ip from a offline player - suni - 06.06.2015

is there a way to get a ip from a account through scriptfile? if yes, can you show me?


Re: getting a ip from a offline player - amirm3hdi - 06.06.2015

You can read files from scriptfiles folder, reading/saving methods are different and you need to save an IP so you can load it later.


Re: getting a ip from a offline player - DanishHaq - 06.06.2015

Well, It's useless to give you the code that I use for my GM. One because my GM is MySQL, and two because it just won't work with yours. What I do is, when the player connects, I change a variable on the player's record (for you, the player's file) called LastIP and have their last IP saved there. So when they logout and an admin uses /ocheck (offline check), they can see the last IP that was used to login. Then they can do whatever they want from there (cross-check IP's etc. etc.)


Re: getting a ip from a offline player - suni - 06.06.2015

damn


Re: getting a ip from a offline player - Yashas - 06.06.2015

This question actually sounds quite silly for me.All I would do is save the last 5 IPs of a player in the player database and retrieve it whenever I need it.

SA-MP doesn't provide any in-built feature using which you can get an IP of an offline player.


Re: getting a ip from a offline player - suni - 06.06.2015

yes it sound silly. but i needed some code for admins to check a player account using some command like /checkip that would search though his account for an ip for unbanning ip.(instead of me going to the scriptfile folder looking for the ip)


Re: getting a ip from a offline player - Jefff - 06.06.2015

Show this file with ips


Re: getting a ip from a offline player - suni - 06.06.2015

the ip store in the account like this
Quote:

[account]
Ip = 192.168.1.11




Re: getting a ip from a offline player - Abagail - 06.06.2015

Just make a variable something like "UnbanIP" and save it. Then when they are being unbanned, load that string into memory and unban it.


Re: getting a ip from a offline player - Jefff - 06.06.2015

and what you to do with this ip? you want for specific player name or search all players with this ip?