What does this means?
#1

Код:
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.
Reply
#2

https://sampwiki.blast.hk/wiki/Strcmp
Reply
#3

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?
Reply
#4

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
Reply
#5

strcmp returns 0 if strings you are comparing are same.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)