I'm not good with strings :S - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I'm not good with strings :S (
/showthread.php?tid=169393)
I'm not good with strings :S -
KaleOtter - 19.08.2010
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
Re: I'm not good with strings :S -
ScottCFR - 19.08.2010
What's wrong with sa-mp's ban system?
Re: I'm not good with strings :S -
iggy1 - 19.08.2010
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.
Re: I'm not good with strings :S -
KaleOtter - 20.08.2010
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.
Re: I'm not good with strings :S -
KaleOtter - 20.08.2010
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.