Adds Command: to string
#1

Hello,

I'm trying to do something like this:
Код:
format(str, sizeof(str), "/test %d", playerid);
OnPlayerCommandText(playerid, str);
And I gets in the string Command: /Test 0 not found...
This adds the Command auto..

I try to do like this:
Код:
printf("%s", str);
      		format(str, sizeof(str), "/test %d", playerid);
		    printf("%s", str);
		    OnPlayerCommandText(playerid, str);
End first return's hello.
the second Command: /test 0

WHat to do?
Reply
#2

Are you using zcmd?

If so, just use cmd_cmdnamehere(playerid,params);
Reply
#3

No, I'm not using any command prc...
Reply
#4

I didnt understood what you actually want
You pass "/test 0" to OnPlayerCommandText
And than you get Command not found, so there isnt a /test command
Reply
#5

noooooo,
ehrn i'm formating the command this adds Command: bofore the slash(/)...
Reply
#6

Код:
public OnPlayerText(playerid, text[]) 
{
    if(strfind(text, "write w/e u want here", true) != -1 && strfind(text, "get car", true) != -1) 
    {
        // our code goes here = whatever u want to happen
    }
    return 1;
}
REP ++ if i helped u :d
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)