SA-MP Forums Archive
a little help - 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: a little help (/showthread.php?tid=195889)



a little help - [Comrade] - 04.12.2010

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


Re: a little help - dice7 - 04.12.2010

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
    }
}