Check a file for banned ips?
#1

I have made a thing that after a ban it saves the banned players ip to a file, how could i check for any IP in the file when playerconnects and if there is his IP it will kick him from the server?
Reply
#2

Why don't you just use Ban(playerid);?
Reply
#3

Because i want to use something creative?
Reply
#4

Quote:
Originally Posted by 0ne
Because i want to use something creative?
Use GetPlayerIP function.
Reply
#5

Could you show me an code example? I know how to store the IP but how to read the file for EVERY IP that is stored and check if his ip is one of those?
Reply
#6

I would recommend using a database, instead of a file.
Reply
#7

Quote:
Originally Posted by cAMo
I would recommend using a database, instead of a file.
Not everyone has the access to use a MySQL database or anything like that.

Use the function GetPlayerIP(playerid);
Reply
#8

You don't understand guys! I know how to get his ip but how to get EVERY IP FROM THE FILE AND THEN CHECK?
Reply
#9

Quote:
Originally Posted by 0ne
You don't understand guys! I know how to get his ip but how to get EVERY IP FROM THE FILE AND THEN CHECK?
Again, use a database.
Reply
#10

arrays - while - fread - strcmp = succes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)