17.11.2012, 02:21
Strcmp returns 0 when the strings match and 1 when the strings don't match. When you check a statement with !, you're checking if it returns 0, otherwise you're checking if it doesn't return 0.
is a check for the function something() returning something other than 0.
is a check for the function something() returning 0.
If you're confused by the way strcmp works, use this macro:
pawn Code:
if(something())
pawn Code:
if(!something())
If you're confused by the way strcmp works, use this macro:
pawn Code:
#define strsame(%0,%1,%2) (!strcmp(%0, %1, %2))
pawn Code:
if(strsame("Hello", "hello", true))
{
}