24.11.2012, 15:22
To use dcmd you need to first define it at the top of your script:
Then, type in OnPlayerCommandText callback:
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:
Just wanted to make sure you know how dcmd works cause it looks like you put that function in some different place.
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
pawn Код:
dcmd(command, 3, cmdtext);
Then to make the actual command contents make this function anywhere outside callbacks:
pawn Код:
dcmd_command(playerid, params[])
{
//code
return 1;
}