SA-MP Forums Archive
Command Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command Error (/showthread.php?tid=113464)



Command Error - Ritchie999 - 13.12.2009

i set up the /commands in OnPlayerCommandText but if i type something like "/g" or "/<anyword>" it shows the "/commands" instead of an error

heres the OnPlayerCommandText section

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128];
    new tmp[256];
    new idx;
    tmp = strtok(cmdtext, idx);
    dcmd(closegate,9,cmdtext);
    dcmd(opengate,8,cmdtext);
    if(strcmp(cmd, "/commands", true) == 0)
    {
        SendClientMessage(playerid,0x800080AA,"[General:]/report | /stats | /register | /login | /eng | /heb | /spn");
        return 1;
    }
    return SendClientMessage(playerid,0xFF8040FF,"[SERVER:] Type /commands to see a list of commands!");
}



Re: Command Error - Grim_ - 13.12.2009

Try changing
pawn Код:
tmp = strtok(cmdtext, idx);
to
pawn Код:
cmd = strtok(cmdtext, idx);



Re: Command Error - Ritchie999 - 13.12.2009

That worked, thanks