03.04.2015, 17:39
I am using ZCMD and want to prevent the user from using all commands but one. How can I do this?
i suggest you to use threshold block and unblokc command system which simple but dynamic
https://sampforum.blast.hk/showthread.php?tid=568459 |
at top of your script and then use NocommandInMinigame() in every command
#define NoCommandInMinigame() if(IsPlayerInMinigame[playerid] == 1) return SendClientMessage(playerid, -1, "use /kill to exit ( only kill cmd will work in deathmatch)" );
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(specBoxing[playerid] == 1)
{
if(strcmp(cmdtext, "/exit", 1, 5)) return 1;
SendClientMessage(playerid, -1, "{FF0000}You are currently spectating the boxing arena. Use /exit to leave it.");
return 0;
}
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[]) { if(strcmp(cmdtext, "/mycommand", true)) return 0; return 1; }