SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/07/2018, 06:36 PM   #1
GospodinX
Big Clucker
 
Join Date: Nov 2017
Posts: 143
Reputation: 20
Default Anti MultiAccount [MySQL]

Hi guys

I'm creating Anti MultiAccount in MySQL.I have big problems with MultiAccounts on my server so I need strong security.

Now I'm make that every connection on my server log in mysql.With information about ip and time login.
Every time when player connect on my server I use this.

Code:
format(eQuery, sizeof(eQuery), "INSERT INTO MULTI(IP, Name,Country,date) VALUES ('%s', '%s' , '%s' ,UNIX_TIMESTAMP())", ip, GetName(playerid),country);
mysql_tquery(g_SQL, eQuery);
Now I don't know how that Admins can see possible multiaccounts so I need:

1) How to get all player IP from MULTI table but without repetition same IP's
2) How to get all connected players but without repetition

For example:
Quote:
A player is login with IP adress 127.0.0.1
B player is also login with 127.0.0.1 IP adress
So A and B player are conncted!They are possible multiaccounts,how to get them(But without repetition of course)


Admins will check this on Admin Panel,not in sa-mp server,so i need just help about mysql query!
GospodinX is offline   Reply With Quote
Old 18/07/2018, 07:00 PM   #2
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 679
Reputation: 110
Default Re: Anti MultiAccount [MySQL]

1)
pawn Code:
SELECT DISTINCT IP FROM MULTI WHERE Name='GospodinX'
2)
pawn Code:
SELECT DISTINCT Name FROM MULTI WHERE IP='127.0.0.1' ORDER BY Name

DISTINCT is like GROUP BY. No duplicates.
Calisthenics is offline   Reply With Quote
Old 18/07/2018, 07:17 PM   #3
GospodinX
Big Clucker
 
Join Date: Nov 2017
Posts: 143
Reputation: 20
Default Re: Anti MultiAccount [MySQL]

Hi!
Thank you very much,that is what i needed!

Last question about it:
Is possible to "connect" it two query(1 and 2) in one:
To get all IP adress from GospodinX and to get all connected names with all ip.

I hope you can understand me.
If GospodinX have three IP adress,i want to see all connected players from all ip adress in one query.

GospodinX 127.0.0.1
GospodinX 127.0.0.2

GospodinY 127.0.0.1

GospodinZ 127.0.0.2

They are all connected,so i want to get it names...

Thank you again,this was very helpful for me!
GospodinX is offline   Reply With Quote
Old 18/07/2018, 07:51 PM   #4
Calisthenics
Gangsta
 
Join Date: May 2018
Posts: 679
Reputation: 110
Default Re: Anti MultiAccount [MySQL]

Combining them in one query will return incorrect results as it will group by the first column.

Show a dialog list with all IPs of a certain player. Clicking on any IP will execute the second query that will show another dialog with all players under that IP.
Calisthenics is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Anti-Cheat ANTIFLY\ANTI GOD\ANTI SKIN BUG\ANTI MONEY HACK\ANTI JETPACK HACK\ANTI GODOFCARS\ANTI FAKEKILL RedMF Lançamentos/Releases 15 19/07/2018 06:29 PM
[Ajuda] MYSQL ANTI CHEAT JhowWatkins Português/Portuguese 3 28/12/2017 05:16 PM
Request anti cheat, anti flyhack | anti ammo hack | anti healt hack | anti aimboter Izaki Scripting Help 1 15/06/2015 04:21 PM


All times are GMT. The time now is 05:34 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.