View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-16-2018 , 15:58   Re: [CS:GO] Help with keyvalue-based ctban plugin
Reply With Quote #4

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.
__________________

Last edited by Psyk0tik; 08-16-2018 at 15:59.
Psyk0tik is offline