Reading a string from a file using Dini
#1

Hey.
I have a system that writes an info about IP being banned into a file using Dini, however I don't really know (yes, what a shame) how to read the written string afterwards and check if it matches with something.
For example, it will write "Banned=Yes", and I want to check if "Banned" is really "Yes" or "No".

I've got something like this:

Код:
new tmp2[100];
	GetPlayerIp(playerid,tmp2,100);
	format(string, sizeof(string), "Bans/%s.ini", tmp2);
	if(fexist(string))
	{
	    new tmp = dini_Get(string, "Banned");
		if(strcmp(tmp, "Yes.", true) == 0)
		{
			Kick(playerid);
		}
	}
But I guess the strcmp isn't right solution here. Any ideas?
Thank you in advance.
Reply


Messages In This Thread
Reading a string from a file using Dini - by Homerman - 12.10.2011, 21:13
Re: Reading a string from a file using Dini - by Wesley221 - 12.10.2011, 21:27
Re: Reading a string from a file using Dini - by Homerman - 13.10.2011, 12:06
Re: Reading a string from a file using Dini - by llama - 13.10.2011, 12:34
Re: Reading a string from a file using Dini - by Homerman - 13.10.2011, 13:47
Re: Reading a string from a file using Dini - by llama - 13.10.2011, 15:09
Re: Reading a string from a file using Dini - by Homerman - 13.10.2011, 16:04
Re: Reading a string from a file using Dini - by Homerman - 14.10.2011, 12:22
Re: Reading a string from a file using Dini - by llama - 14.10.2011, 14:46
Re: Reading a string from a file using Dini - by Homerman - 14.10.2011, 21:27

Forum Jump:


Users browsing this thread: 3 Guest(s)