Error in compiler
#4

To use dcmd you need to first define it at the top of your script:
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Then, type in OnPlayerCommandText callback:
pawn Код:
dcmd(command, 3, cmdtext);
Where 'command' is the command you want to have, the second parameter '3' is the length of the command without the slash. Leave 'cmdtext' like it is.
Then to make the actual command contents make this function anywhere outside callbacks:
pawn Код:
dcmd_command(playerid, params[])
{
    //code

    return 1;
}
Just wanted to make sure you know how dcmd works cause it looks like you put that function in some different place.
Reply


Messages In This Thread
Error in compiler - by Goldino - 24.11.2012, 13:20
Re: Error in compiler - by jakejohnsonusa - 24.11.2012, 13:22
Re: Error in compiler - by Glad2BeHere - 24.11.2012, 13:33
Re: Error in compiler - by YoYo123 - 24.11.2012, 15:22

Forum Jump:


Users browsing this thread: 1 Guest(s)