Some problems
#1

Simple question, when i put a player in a mini-game, how can i disable all cmds, but just enable 1 or 2?
Reply
#2

Put a check in on PlayerCommandText (or its equivalent) check if a player is in a mingame if he is, then compare the command to the commands you want to be enabled. If they are not the right ones return 0.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(InMinigame[playerid] == 1)
    {
        if(!strcmp(cmdtext,"/shop")true)//allow this command
        {
            //do somethnig
            return 1;
        }
        return 0;//or you could send a message saying command not available in minigames
    }
    return 0;
}
EDIT: to disable all is very easy

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(InMinigame[playerid] == 1)return 0;//or you could send a message saying command not available in minigames
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}
"InMinigame" being a variable that you initialise at 1 when a player enters a minigame.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)