dcmd help
#9

Or look at this quote from that topic:
Quote:
Originally Posted by ZeeX
Yes, you can combine zcmd with usual commands or dcmd:

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/command1", true))
    {
        SendClientMessage(playerid, 0x00FFFFFF, "usual command");
        return 0;
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command");
    return 1;
}

COMMAND:command2(playerid)
{
    SendClientMessage(playerid, 0x00FF00FF, "zcmd command");
    return 1;
}
But you will have to switch "return 1" to "return 0" in every command to get them working. To avoid this, change the following line in the include (# 85):

pawn Код:
if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
to this one:

pawn Код:
if (zcmd_g_HasOPCS && CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
Then you can just copy all your commands from OnPlayerCommandText and paste them to OnPlayerCommandReceived:

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if (!strcmp(cmdtext, "/command1", true))
    {
        SendClientMessage(playerid, 0x00FFFFFF, "command1");
        return 1;
    }
    ....
    ....

    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command");
    return 0;
}

Reply


Messages In This Thread
dcmd help - by Lajko1 - 20.12.2009, 06:48
Re: dcmd help - by Lajko1 - 20.12.2009, 10:29
Re: dcmd help - by Marcel - 20.12.2009, 10:32
Re: dcmd help - by Lajko1 - 20.12.2009, 11:03
Re: dcmd help - by Lajko1 - 20.12.2009, 14:10
Re: dcmd help - by Zeex - 20.12.2009, 14:22
Re: dcmd help - by Lajko1 - 20.12.2009, 14:51
Re: dcmd help - by Zeex - 20.12.2009, 14:55
Re: dcmd help - by Marcel - 20.12.2009, 15:10
Re: dcmd help - by Lajko1 - 20.12.2009, 15:14

Forum Jump:


Users browsing this thread: 3 Guest(s)