12.10.2011, 21:13
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:
But I guess the strcmp isn't right solution here. Any ideas?
Thank you in advance.
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); } }
Thank you in advance.