How can i make player not use commands while jailed ?
#1

Like the title says - that didn't work

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
  if(
Mute[playerid] == 1
  {
    
SendClientMessage(playerid, -1"{FF0000}You're jailed, you're muted and you are not allowed to use commands.");
    return 
0;
  }
  else
  {
    if(
Mute[playerid] == 0) return 1;
  }
  return 
1;

Reply
#2

Remove the "else" part, you don't need it.
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Your Command", cmdtext, true, 10) == 0)
    {
        if(Mute[playerid] == 1)
        {
            return SendClientMessage(playerid, -1, "{FF0000}You're jailed, you're muted and you are not allowed to use commands.");
        }
        else if(Mute[playerid] == 0) return 1;
    }
    return 0;
}
Reply
#4

same
Reply
#5

are you maybe using zcmd?

in this case use
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[]);
instead of OnPlayerCommandText
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)