22.07.2012, 16:37
In the first code it's checking if Strcmp returns 0 and in the second code it's checking if it returns 1.
Strcmp returns:
More examples with other functions like IsPlayerAdmin
You can find more info in the wiki article about Control Structures.
Strcmp returns:
Quote:
Originally Posted by Wiki
-1 if string1 comes before string2
1 if string1 comes after string2 0 if the strings are the same (for the matched length). |
pawn Код:
if(IsPlayerAdmin(playerid) == 1) // checks if IsPlayerAdmin returns 1 (Logged into rcon)
if(IsPlayerAdmin(playerid)) // checks if IsPlayerAdmin returns 1 too (Logged into rcon)
// // // //
if(!IsPlayerAdmin(playerid)) // checks if IsPlayerAdmin returns 0 (Not logged)
if(IsPlayerAdmin(playerid) == 0) // checks if IsPlayerAdmin returns 0 too (Not logged)