I noticed that you're getting the same client's Steam ID twice and comparing them to each other. If the kv.JumpToKey() already finds the client's Steam ID, you don't need to check for a match inside it.
Also, since you're checking for empty strings, change
!sTimeLeft[0] to
sTimeLeft[0] != '\0' because
!sTimeLeft[0] looks more like you're checking
sTimeLeft[0] == '\0' which is only triggering when the string is EMPTY.
Basically, this:
PHP Code:
// what you currently have...
if (sTimeLeft[0] == '\0') // if string is empty (!sTimeLeft[0])
{
ctban[client] = StringToInt(sTimeLeft); // converts the empty string to an int which is basically nothing...
}
else // if string is NOT empty
{
ctban[client] = 0; // ban duration is set to 0.
}
TL;DR: You may have your checks reversed.
__________________