Rcon + sql problem
#2

Hey, just a little suggestion:
Instead of doing
Код:
if(!success) 
{
    format(string, sizeof(string), "IP: %s || Pass: %s || Success: FAILED", ip, password);
} 
else 
{
    format(string, sizeof(string), "IP: %s || Pass: %s || Success: SUCCESS", ip, password);
}
you could use a ternary operator and do
Код:
format(string, sizeof(string), "IP: %s || Pass: %s || Success: %s", (success) ? ("SUCCESS") : ("FAILED"), ip, password);
That's not necessary, but I think that would be better.
Reply


Messages In This Thread
Rcon + sql problem - by TwinkiDaBoss - 17.11.2016, 19:05
Re: Rcon + sql problem - by GoldenLion - 17.11.2016, 19:16
Re: Rcon + sql problem - by TwinkiDaBoss - 17.11.2016, 19:19
Re: Rcon + sql problem - by SickAttack - 17.11.2016, 19:31
Re: Rcon + sql problem - by TwinkiDaBoss - 17.11.2016, 19:33

Forum Jump:


Users browsing this thread: 4 Guest(s)