a little help
#1

Hey guys, how can i use command with a ! for example instead of typing like "/team" or "/t" i could just put in ! and then Txt. I tried doing
Код:
	if(strcmp(cmd, "/T", true) == 0 || strcmp(cmd, "!", true) == 0)
but i'm doing something wrong the "/T" works but ! doesnot
Reply
#2

OnPlayerCommandText only gets called if the first character from the players input is '/'.
Use OnPlayerText

pawn Код:
public OnPlayerText(playerid, text[])
{
    if (strcmp(text, "!doSomething") == 0)
    {
        //do something
        return 0; // so "!doSomething" wont get displayed in the chat
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)