Registered accounts on a IP
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

@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
Reply
#5

Show both accounts and iplog table structure
Reply
#6

@Owain Here you go

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

Users Structure: http://imgur.com/ncj1xRI.png
Reply
#7

"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).
Reply
#8

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

Yes, execute the query in OnPlayerRegister.
Reply
#10

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,"","");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)