[Question] Strcmp - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Question] Strcmp (
/showthread.php?tid=106815)
[Question] Strcmp -
Matthew_Murdoch - 05.11.2009
Whats the difference between:
if(strcmp)cmd, "command, true) == 0)
AND
if(strcmp)cmdtext, "cmd", true, 10) == 0)
AND
if(strcmp)"/cmd", cmdtext, true) == 0)
etc etc, is there a difference? Functions?
Re: [Question] Strcmp -
Sergei - 05.11.2009
pawn Код:
if(!strcmp("/command",cmdtext,true))
if(!strcmp(cmdtext,"/command",true))
Same thing. Like if you say "USA vs China" or "China vs USA".
Re: [Question] Strcmp -
Daren_Jacobson - 05.11.2009
it also affects the return value if they are not equal
from String_Manipulation.pdf
The return value is:
−1 if string1 comes before string2,
1 if string1 comes after string2, or
0 if the strings are equal (for the matched length).