Strcmp returns 0?
#1

Hi.
I've got a simple command defined like

Код:
if(!strcmp("/lol", cmdtext, true, 11))
{
which works without any problem. However, when I use strcmp inside it, it always returns 0; - meaning it just pops up "SERVER: Unknown command".

Код:
if(!strcmp("/lol", cmdtext, true, 11))
{
    new tmp[256], idx;
 	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp))
	{
	    SendClientMessage(playerid, RED, "Syntax: /lol something");
	    return 1;
	}
	if(strcmp(tmp, "something", true) == 0)
	{
 // SOMETHING INSIDE HERE
	}
return 1;
}
Looks like this (of course I edited it, this is not the whole command just preview.
Anybody knows what's the problem here please? Thanks!
Reply


Messages In This Thread
Strcmp returns 0? - by Homerman - 25.11.2011, 12:13
Re: Strcmp returns 0? - by Kostas' - 25.11.2011, 12:15
Re: Strcmp returns 0? - by Homerman - 25.11.2011, 12:31
Re: Strcmp returns 0? - by |_ⒾⓇⓄN_ⒹⓄG_| - 25.11.2011, 12:32
Re: Strcmp returns 0? - by Homerman - 25.11.2011, 12:34
Re: Strcmp returns 0? - by Kostas' - 25.11.2011, 12:38
Re: Strcmp returns 0? - by Homerman - 25.11.2011, 12:41
Re: Strcmp returns 0? - by Kostas' - 25.11.2011, 12:50
Re: Strcmp returns 0? - by Homerman - 25.11.2011, 12:54
Re: Strcmp returns 0? - by MP2 - 25.11.2011, 12:58

Forum Jump:


Users browsing this thread: 1 Guest(s)