Thread: commands
View Single Post
Old 24/08/2011, 07:59 AM   #4
[HiC]TheKiller
High-roller
 
Join Date: Mar 2008
Location: New Zealand
Posts: 2,629
Reputation: 410
Default Re: commands

Just use the function OnPlayerCommandReceived which is included in ZCMD.

pawn Code:
new helped[MAX_PLAYERS];
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(strcmp("/help", cmdtext, true) != 0 && !helped[playerid])
    {
        SendClientMessage(playerid, -1, "You must type /help first!");
        return 0;
    }
    return 1;
}
CMD:help(playerid, params[])
{
    if(!helped[playerid]) helped[playerid] = 1;
    //.....
    return 1;
}
public OnPlayerConnect(playerid)
{
    helped[playerid] = 0;
    return 1;
}

Give that a go.
__________________
[HiC]TheKiller is offline