[Ajuda] Comando /calar nao funciona
#1

O Titulo Ja Diz
Aparece q cala mais o player continua falando !

Comando /Calar
pawn Код:
COMMAND:calar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
SendAdminText(playerid, "/calar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /calar [id] [motivo]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = true;
format(Msg, 128, "{FF0000}-| %s  foi calado por %s. Motivo: %s |-", Name, AdminName, Reason);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}

Comando /Descalar
pawn Код:
COMMAND:descalar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], OtherPlayer;
SendAdminText(playerid, "/descalar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /descalar [id]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = false;
format(Msg, 128, "{FF0000}-| O Administrador %s permitiu que %s volte a falar |-", AdminName, Name);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nao esta online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
Reply
#2

Alguem ?
Reply
#3

Testa ae!

pawn Код:
CMD:calar(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /calar [id]");
                return 1;
            }
                        new giveplayer[MAX_PLAYER_NAME];
                    new sendername[MAX_PLAYER_NAME];
            new playa;
            playa = ReturnUser(tmp);

            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(admtrampando[playerid] >= 1)
                {
                    SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
                    return 1;
                }
                if(IsPlayerConnected(playa))
                {
                    if(playa != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));

                        if(PlayerInfo[playa][pMuted] == 0)
                        {
                            PlayerInfo[playa][pMuted] = 1;
                            format(string, sizeof(string), "AdminCmd: %s Foi calado por %s",giveplayer ,sendername);
                            ABroadCast(COLOR_LIGHTRED,string,1);
                        }
                        else
                        {
                            PlayerInfo[playa][pMuted] = 0;
                            format(string, sizeof(string), "%s Foi descalado por %s",giveplayer ,sendername);
                            ABroadCast(COLOR_LIGHTRED,string,1);
                        }
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
            }
        }
        return 1;
    }
Reply
#4

pawn Код:
public OnPlayerText(playerid, text[])
{
     if(APlayerData[playerid][Muted] == true)return SendClientMessage(playerid, GetPlayerColor(playerid), "[ERRO]Vocк esta calado!");
     return 0;
}

Att Merida
Reply
#5

pawn Код:
/ Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he'
s still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce estб Mudo Agora.");

// Don't allow his text to be sent to the chatbox
return 0;
}

return 1;
}
Ja ta no meu On Player text
Reply
#6

Ta ae mano

fiz de um geito simplez porem funcional

pawn Код:
new Calado[MAX_PLAYERS] = 0; // topo do GM

OnPLayerConnect

Calado[playerid] = 0; // iremos iniciar o o calado com 0 dai quando ele conectar ele n fica mudo
//OnPlayerText

pawn Код:
if(Calado[playerid] == 1)
{
SendClientMessage(playerid, Amarelo, "| ERRO | Vocк estб calado e nгo pode falar!");
return 0;
}
//Os comandos agora

pawn Код:
COMMAND:calar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], Reason[128], OtherPlayer;
SendAdminText(playerid, "/calar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Use: /calar [id] [motivo]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = true;
Calado[playerid] = 1;
format(Msg, 128, "{FF0000}-| %s  foi calado por %s. Motivo: %s |-", Name, AdminName, Reason);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nгo estб online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
Descalar

pawn Код:
COMMAND:descalar(playerid, params[])
{
new Msg[128], Name[24], AdminName[24], OtherPlayer;
SendAdminText(playerid, "/descalar", params);
if (APlayerData[playerid][LoggedIn] == true)
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "u", OtherPlayer)) SendClientMessage(playerid, 0xFF0000AA, "Use: /descalar [id]");
else
{
if (IsPlayerConnected(OtherPlayer))
{
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(OtherPlayer, Name, sizeof(Name));
APlayerData[OtherPlayer][Muted] = false;
Calado[playerid] = 0;
format(Msg, 128, "{FF0000}-| O Administrador %s permitiu que %s volte a falar |-", AdminName, Name);
SendClientMessageToAll(0xFFFFFFFF, Msg);
PlayerFile_Save(OtherPlayer);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}O jogador nao esta online.");
}
}
else
return 0;
}
else
return 0;
return 1;
}
ta ae sу adaptar
Reply
#7

Quote:
Originally Posted by Luucass
Посмотреть сообщение
pawn Код:
/ Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he'
s still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce estб Mudo Agora.");

// Don't allow his text to be sent to the chatbox
return 0;
}

return 1;
}
Ja ta no meu On Player text
coloca apos mandar a msg a retornar para 1
Reply
#8

@StandBy e @ PT
Continua A MSM Coisa , aparece que foi calado mais o player continua falando
Reply
#9

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(APlayerData[playerid][Muted] == true)
    {
        SendClientMessage(playerid, 0xFF0000AA, "Foste calado e nгo podes falar!");
        return 1;
    }
    return 0;
}
E complicado escrever Code pelo Cell rsrsrs
Reply
#10

@PT
O User ainda continua falando , avisa q o admin calou ele mais , ele pode falar !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)