What does this means? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What does this means? (
/showthread.php?tid=307286)
What does this means? -
Outcast - 29.12.2011
Код:
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.
Re: What does this means? -
PowerPC603 - 29.12.2011
https://sampwiki.blast.hk/wiki/Strcmp
Re: What does this means? -
Outcast - 29.12.2011
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?
Re: What does this means? -
[ABK]Antonio - 29.12.2011
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
Re: What does this means? -
JiHost - 29.12.2011
strcmp returns 0 if strings you are comparing are same.