SA-MP Forums Archive
Registered accounts on a IP - 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: Registered accounts on a IP (/showthread.php?tid=614284)



Registered accounts on a IP - Digii - 06.08.2016

Hello SA:MP scripters, I have a concern how can I make when someone registered an account on my server will show admins how many accounts are registered in the same IP he's got.

Sorry for bad english.

Hope to get some help, thank you bros.


Re: Registered accounts on a IP - xTURBOx - 06.08.2016

i have been thinking to make something similar for a while, but i am afraid I just haven't got around it.

ps thanks for the inspiration.


Re: Registered accounts on a IP - Flake. - 06.08.2016

If you're using mysql to save your player accounts, log their IP when they register, every time a new player registers select all IPs that are equal to the new players IP.


Re: Registered accounts on a IP - Digii - 07.08.2016

@xTURBOx No problem

@Flake. Yes, I'm using mysql and I've got in my phpmyadmin > mydb > iplogs but I don't know how to make them to count how many accounts are registered with the same ip

Thanks for reply


Re: Registered accounts on a IP - [cS]Owain - 07.08.2016

Show both accounts and iplog table structure


Re: Registered accounts on a IP - Digii - 07.08.2016

@Owain Here you go

IPlog structure : http://imgur.com/EA1ldkX.png

Users Structure: http://imgur.com/ncj1xRI.png


Re: Registered accounts on a IP - Konstantinos - 07.08.2016

"playerid" is the unique ID from Users table, right?

pawn Код:
mysql_format(..., "SELECT COUNT(DISTINCT playerid) FROM IPlog WHERE ip='%e';", ip_here);
It returns the number of players (no duplicates) with the same IP (1 row always, retrieve it as integer).


Re: Registered accounts on a IP - Digii - 07.08.2016

@Konstantinos Yes is Unique so, I'm adding the code you gave me OnPlayerRegister or sum kinda of?


Re: Registered accounts on a IP - Konstantinos - 07.08.2016

Yes, execute the query in OnPlayerRegister.


Re: Registered accounts on a IP - Digii - 07.08.2016

I Tried to do as you said but it keeps giving me argument missmatch (argument 3)

Код:
		mysql_format(SQL,Str, "SELECT COUNT(DISTINCT playerid) FROM `iplogs` WHERE ip='%e';", ip_here);
		mysql_tquery(SQL,Str,"","");