05.06.2015, 21:02
Here's how you can enable/disable a command in-game by typing /disablecmd rename disablecmd to whatever you want
use this in a command you want to be disabled
This only works for a single command though, to disable more commands you can make a new variable and command
for example:
Код:
new DisableCMD[MAX_PLAYERS]; CMD:disablecmd(playerid, params[]) { if (adlvl[playerid] < 5) return 0; if(DisableCMD == 1) { DisableCMD = 0; SendClientMessage(playerid, -1, "Command has been enabled."); } else { DisableCMD = 1; SendClientMessage(playerid, -1, "Command has been disabled."); } return 1; }
Код:
if(DisableCMD == 1) return SendClientMessage(playerid, COLOR_RED, "this command is disabled by admins.");
for example:
Код:
new DisableCMD2[MAX_PLAYERS]; CMD:disablecmd2(playerid, params[]) { if (adlvl[playerid] < 5) return 0; if(DisableCMD2 == 1) { DisableCMD2 = 0; SendClientMessage(playerid, -1, "Command 2 has been enabled."); } else { DisableCMD2 = 1; SendClientMessage(playerid, -1, "Command 2 has been disabled."); } return 1; } if(DisableCMD2 == 1) return SendClientMessage(playerid, COLOR_RED, "this command is disabled by admins.");