SA-MP Forums Archive
if(!strcmp not working... - 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: if(!strcmp not working... (/showthread.php?tid=438101)



if(!strcmp not working... - RandomDude - 18.05.2013

pawn Код:
if(!strcmp("9-2", text, true) && strlen(text)==strlen("10-0") && Code == true)
    {
        SendClientMessageToAll(0xDEEE20FF, "HELP");
    }
The code won't work what I want it to do is when a player types 9-2 it shows Use Cation in the main chat and it says the name of the person who said it etc..

RandomDude[0]: HELP

it would come like that if i type 9-2


Re: if(!strcmp not working... - RandomDude - 18.05.2013

Need help


Re: if(!strcmp not working... - Revo - 18.05.2013

Compile with this before the if and show us the result.
pawn Код:
printf("text: %s - strlen(text): %d - strlen(\"10-0\"): %d - Code: %s", text, strlen(text), strlen("10-0"), (Code ? ("true") : ("false"));
Then again, with that info you could probably figure the rest out on your own.