Text, or command?
#1

resolved. thanks.
Reply
#2

@ onplayertext

pawn Код:
if(text[0] == '@')
{
//do your code...
}
Reply
#3

Thanks, trying it now.
Reply
#4

I've once created a "chat commands" system, I guess that it could be useful:
pawn Код:
// OnPlayerText
    if(text[0] == '@')
    {
        if(!OnPlayerChatCommand(playerid,text)) SendClientMessage(playerid,0xffffffff,"SERVER: Unknown chat command.");
        return 0;
    }
pawn Код:
// New callback
forward OnPlayerChatCommand(playerid,cmdtext[]);
public OnPlayerChatCommand(playerid,cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext,idx);
    if(equal(cmd,"@help") || equal(cmd,"@cmd"))
    {
        SendClientMessage(playerid,0xffffffff,"Help...");
        // ...
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)