I'm not good with strings :S
#1

Ey, I'm making a ban system, so I got a file BannedStunt.txt (witch means; banned players in my stunt mode).
I never realy worked with files on this way, Normaly just some dini account files or read/save files.
How can I put a IP in this file? and how can check if the player IP is in this file when he connect?
I don't think this will be a huge code. But I just need to know it
Thanku
Reply
#2

What's wrong with sa-mp's ban system?
Reply
#3

This is how id do it although iv never used dini just djson
where ever you save your ips.
pawn Код:
new ip[16];
GetPlayerIp(playerid, ip,16);
//save the string to dini here
OnPlayerConnect
pawn Код:
new pip[16];
GetPlayerIp(playerid, pip,16);
if(strcmp(DINI_STRING,pip))//As i said i dont know dini so swap 'DINI_STRING'
{                           //for a function that reads the string from the players ini file.
    //kick?
}
Not tested should work if u understand me.
Reply
#4

Quote:
Originally Posted by iggy1
Посмотреть сообщение
This is how id do it although iv never used dini just djson
where ever you save your ips.
pawn Код:
new ip[16];
GetPlayerIp(playerid, ip,16);
//save the string to dini here
OnPlayerConnect
pawn Код:
new pip[16];
GetPlayerIp(playerid, pip,16);
if(strcmp(DINI_STRING,pip))//As i said i dont know dini so swap 'DINI_STRING'
{                           //for a function that reads the string from the players ini file.
    //kick?
}
Not tested should work if u understand me.
Ok thanks I will look if I can use it, I think so.
Reply
#5

Quote:
Originally Posted by ScottCFR
Посмотреть сообщение
What's wrong with sa-mp's ban system?
Do I ask for that question?
And read before you post something like this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)