22.11.2016, 07:10
22nd November Update
Fixed a bug with ExecuteCommand (success parameter used to be set wrongly). No change in syntax.
View Include
---------------------------------------------------------------------------------------------------------------
If you are trying to make an alternate name for a command, use the ALT syntax.
Do as Konstantinos said. If you get an undefined symbol error, use the following code:
By the way, you can pass anything as cmdid as long as you don't use the command id parameter in the your command.
However, using the correct command id will future proof your code. The effect on performance is negligible if you make use of static variables to store the command id.
Fixed a bug with ExecuteCommand (success parameter used to be set wrongly). No change in syntax.
View Include
---------------------------------------------------------------------------------------------------------------
Quote:
With zcmd, I used to return whole cmds with "return cmd_kiss(playerid, "");". If I try to do "return cmd_kiss(cmdid, playerid, "");" it give me error (error 017: undefined symbol "cmdid"). What should I do? I must use this function: GetCommandID?
|
Do as Konstantinos said. If you get an undefined symbol error, use the following code:
Код:
static cmdid = -2; if(cmdid == -2) cmdid = GetCommandID("urcmd"); cmd_urcmd(cmdid, playerid, params);
Код:
cmd_urcmd(1231231, playerid, params)