04.06.2015, 10:25
In the DM mode how to prohibit players to use the command
public OnPlayerCommandText(playerid, cmdtext[])
{
if(dm_check[playerid]) return SendClientMessage(playerid, -1, "You cannot use commands while you are in DM.");
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(dm_check[playerid]) return SendClientMessage(playerid, -1, "You cannot use commands while you are in DM.");
return 1;
}
If you are using OnPlayerCommandText, then simply return 0 or 1 whenever a player types one, must be on the top.
Example: pawn Код:
In case of zcmd, we'll do same but in zcmd's custom callback: pawn Код:
You can also perform those checks in each command. |