PDA

View Full Version : What does this means?


Outcast
29/12/2011, 11:22 PM
if(strcmp(string, "Ban", true) == 0) //if any of the lines in the file say "Ban" the system will ban the player
{
Ban(playerid); //bans the player
}


What does the "== 0" part means? Will it ban the player if it just says "Ban" in the script file or it will ban only if Ban=0 ?

Please help, thank you.

PowerPC603
29/12/2011, 11:29 PM
http://wiki.sa-mp.com/wiki/Strcmp

Outcast
29/12/2011, 11:33 PM
So, if in the userfile it says Ban=1, and I type into the strcmp if(strcmp(string, "Ban=1", true) == 0) it will then ban the player? Right?

[ABK]Antonio
29/12/2011, 11:37 PM
if that's on onplayercommandtext it will ban you if you type /ban or if its on onplayertext and string = text then it will ban you too

JiHost
29/12/2011, 11:41 PM
strcmp returns 0 if strings you are comparing are same.