PHP код:
forward disabled(cmdid, playerid, params[])
public disabled(cmdid, playerid, params[])
{
return SendClientMessage(playerid, RED, "The command has been disabled.");
}
CMD<ACMD>:disablecmd(cmdid, playerid, params[])
{
switch(ReassignCommandFunction(GetCommandID(params), "disabled"))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already disabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been disabled.");
}
return CMD_SUCCESS;
}
CMD<ACMD>:enablecmd(cmdid, playerid, params[])
{
new cmd_func[MAX_FUNC_NAME], cid = GetCommandID(params);
GetCommandFunctionName(cid, cmd_func);
switch(ReassignCommandFunction(cid, cmd_func))
{
case -1: return SendClientMessage(playerid, RED, "The entered command does not exist.");
case 0: return SendClientMessage(playerid, RED, "The entered command is already enabled.");
case 1: return SendClientMessage(playerid, RED, "The entered command has been enabled.");
}
return CMD_SUCCESS;
}