[Ajuda] Calar Nao Funciona
#1

quando digita /calar ele aparece o texto q o user foi calado , mais ele continua falando , quando usa o mp ele fala q ta calado ? oq pode ta acontecendo
CMD's

/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;
}

OnPlayerText
pawn Код:
public OnPlayerText(playerid, text[])
{

// 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 1;
}

return 1;
}

Espero que alguйm me ajude
Reply
#2

Troque o PRIMEIRO return 1; por return 0; (na OnPlayerText)
Reply
#3

Modifique sua public OnPlayerText para esta:

PHP код:
public OnPlayerText(playeridtext[])
{
    
// Block the player's text if he has been muted
    
if (APlayerData[playerid][Muted] == true)
    {
        
// Let the player know he's still muted
        
SendClientMessage(playerid0xFFFFFFFF"{808080}Voce estб Mudo Agora.");
        
// Don't allow his text to be sent to the chatbox
        
return 0;
    }
    return 
1;

Reply
#4

Opps Continua a mesma coisa !
Reply
#5

Bota no comeзo da callback a msg que ta calado .
pawn Код:
public OnPlayerText(playerid, text[])
{
    if (APlayerData[playerid][Muted] == true)return SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Voce estб Mudo Agora.");
    return 1;
}
Reply
#6

@mau.tito
continua ! podendo falar
Reply
#7

Up ?
Reply
#8

Tenta ai й do ppc_trucking

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;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    // 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, "{FF0000}Vocк ainda estб mudo.");

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

    return 1;
}
Reply
#9

pawn Код:
public OnPlayerText(playerid, text)
{
    new Msg[128], Nome[MAX_PLAYER_NAME];

    GetPlayerName(playerid, Nome, );

        // 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, "{FF0000}Vocк ainda estб mudo.");

        // Don't allow his text to be sent to the chatbox
        return 0;
    }
    else
    {
        format(Msg, sizeof(Msg), "%s: {FFFFFF}%s", Nome, text);
        SendClientMessageToAll(GetPlayerColor(playerid), Msg)
        return 1;
    }

    return 0; // AQUI RETORNA ZERO NA PPC TRUCK
}
OBS: tu baixou o BR truck nй? OU foi o TOB? Esses dois sгo bugadхes, tu vai ter mo trabalho para desbugar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)