No /q - 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: No /q (
/showthread.php?tid=158589)
No /q -
BP13 - 10.07.2010
How do I make it so if someone says like "go to /q" it does not send the whole chat line if /q is next to each other in a sentence.
Re: No /q -
cessil - 10.07.2010
use strfind
Re: No /q -
BP13 - 10.07.2010
Would this work?
pawn Код:
if(strfind("text", "/q", true) != -1)
{
SendClientMessage(playerid,ADMIN_RED,"You Sir are a moron!");
return 1;
}
Re: No /q -
Calgon - 10.07.2010
Quote:
Originally Posted by BP13
Would this work?
pawn Код:
if(strfind("cmdtext", "/q", true) != -1) { SendClientMessage(playerid,ADMIN_RED,"You Sir are a moron!"); return 1; }
|
No... You don't use the quotes, it's a VARIABLE.
Re: No /q -
BP13 - 10.07.2010
Quote:
Originally Posted by Calgon
No... You don't use the quotes, it's a VARIABLE.
|
Thanks. It works.
pawn Код:
#include <a_samp>
public OnPlayerText(playerid, text[])
{
if(strfind(text, "/q", true) != -1)
{
SendClientMessage(playerid,0xE60000FF,"You Sir are a moron!");
return 0;
}
return 1;
}