Text, or command?
#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


Messages In This Thread
Text, or command? - by GamingTurf - 10.12.2011, 15:27
Re: Text, or command? - by fordawinzz - 10.12.2011, 15:28
Re: Text, or command? - by GamingTurf - 10.12.2011, 15:31
Re: Text, or command? - by Amit_B - 10.12.2011, 15:45

Forum Jump:


Users browsing this thread: 1 Guest(s)