#1

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.
Reply
#2

use strfind
Reply
#3

Would this work?

pawn Код:
if(strfind("text", "/q", true) != -1)
{
    SendClientMessage(playerid,ADMIN_RED,"You Sir are a moron!");
    return 1;
}
Reply
#4

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.
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)