commands
#5

Quote:
Originally Posted by [HiC]TheKiller
View Post
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.
I don't think that will work as he wish.
pawn Code:
new bool:CMD[MAX_PLAYERS];

public OnPlayerCommandReceived(playerid,cmdtext[])
{
    if(CMD[playerid] == false)
    {
        if(!strcmp("/help",cmdtext)) return 1;
        SendClientMessage(playerid,0,"Error");
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    CMD[playerid] = true;
    return 1;
}
Reply


Messages In This Thread
commands - by Speed - 24.08.2011, 07:50
Re: commands - by Horrible - 24.08.2011, 07:52
Re: commands - by =WoR=Varth - 24.08.2011, 07:52
Re: commands - by [HiC]TheKiller - 24.08.2011, 07:59
Re: commands - by =WoR=Varth - 24.08.2011, 08:11
Re: commands - by [HiC]TheKiller - 24.08.2011, 08:21
Re: commands - by =WoR=Varth - 24.08.2011, 08:32
Re: commands - by doreto - 24.08.2011, 08:37
Re: commands - by [HiC]TheKiller - 24.08.2011, 08:41
Re: commands - by =WoR=Varth - 24.08.2011, 08:41
Re: commands - by Lorenc_ - 24.08.2011, 08:44
Re: commands - by =WoR=Varth - 24.08.2011, 08:52
Re: commands - by Speed - 24.08.2011, 09:19
Re: commands - by Speed - 24.08.2011, 09:26
Re: commands - by [HiC]TheKiller - 24.08.2011, 09:37

Forum Jump:


Users browsing this thread: 3 Guest(s)