SA-MP Forums Archive
[Ajuda] ChatGlobal - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] ChatGlobal (/showthread.php?tid=495827)



ChatGlobal - eNtinityGaming - 19.02.2014

Bom coloquei para players normais e admins falarem no chat global personalizado, sу q n funciona, tipo fica o estilo do gamemode do 0, tipo:

Vinicius: Oi oi oi
sendo q era pra ser o exemplo abaixo:


pawn Код:
public OnPlayerText(playerid, text[])
{
    if(BloquearChat[playerid] == 1)
    {
             SendClientMessage(playerid, red, "[x] O chat estб desativado e vocк nгo poderб digitar.");
             return 0;
    }
    if(mute[playerid]==1)
    {
        SendClientMessage(playerid, red, "[x] Voce estб calado e nгo pode falar no chat.");
        return 0;
    }
    if(strlen(text) >= 70)
    {
        SendClientMessage(playerid,red,"[x] Seu texto nгo foi enviado pois estб muito grande.");
        return 0;
    }
    if(EstaAFK[playerid] == 0)
    {
        TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
        EstaAFK[playerid] = 1;
        return 1;
    }
    else if(EstaAFK[playerid] == 1)
        {
            KillTimer(TFora[playerid]);
            TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
            EstaAFK[playerid] = 1;
            return 1;
        }
    if(PInfo[playerid][Level] >= 1)
    {
        new string[356], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "[ %d ] [ ADM ] %s{FFFFFF}  %s", playerid, pname, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    if(PInfo[playerid][Level] <= 0)
    {
        new string[356], pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(string, sizeof(string), "• [ %d ] %s{FFFFFF}  %s", playerid, pname, text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}

E agora?


Re: ChatGlobal - eNtinityGaming - 19.02.2014

Help-me?


Re: ChatGlobal - eNtinityGaming - 19.02.2014

Alguem por favor me ajuda?


Re: ChatGlobal - Wanderson_SAMP - 19.02.2014

Se й para o admin fala....

Код:
if(PInfo[playerid][Level] >= 1)
isso es errado. Cade a variavel do admin u.ъ


Re: ChatGlobal - eNtinityGaming - 19.02.2014

Ai у a variavel й Level cara
nгo й rpg nгo que usa pAdmin Admin '-'
й Level mesmo.


Re: ChatGlobal - Wanderson_SAMP - 19.02.2014

Entгo que tem mas que 1 de level is ADM kkkk'

nгo entendi sua logica, hoje to burro, mals.


Re: ChatGlobal - Sky™ - 19.02.2014

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[129];
    if(BloquearChat[playerid] == 1) return SendClientMessage(playerid, red, "[x] O chat estб desativado e vocк nгo poderб digitar.");
    if(mute[playerid] == 1) return SendClientMessage(playerid, red, "[x] Voce estб calado e nгo pode falar no chat.");
    if(strlen(text) >= 70) return SendClientMessage(playerid,red,"[x] Seu texto nгo foi enviado pois estб muito grande.");

    if(!EstaAFK[playerid]){
        TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
        EstaAFK[playerid] = 1;
        return 0;
    }
    else
    {
        KillTimer(TFora[playerid]);
        TFora[playerid] = SetTimerEx("Fora", 60000, 1, "i", playerid);
        EstaAFK[playerid] = 1;
        return 0;
    }
    if(PInfo[playerid][Level] >= 1){
        format(string, sizeof(string), "[ %d ] [ ADM ] %s {FFFFFF}%s", playerid, GetNameEx(playerid), text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
        return 0;
    }
    else
    {
        format(string, sizeof(string), "• [ %d ] %s {FFFFFF}%s", playerid, GetNameEx(playerid), text);
        SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}

//Fora da callback
GetNameEx(idx)
{
    new Sk[MAX_PLAYER_NAME];
    GetPlayerName(idx, Sk, sizeof(Sk));
    return Sk;
}
Nгo testado!


Re: ChatGlobal - eNtinityGaming - 19.02.2014

Nгo funcionou. Ou seja o texto estб normal

Vinicius: Eae
Sendo q era pra ficar
[ 0 ] [ ADM ] Vinicius: Eae


Re: ChatGlobal - Sky™ - 19.02.2014

Quote:
Originally Posted by eNtinityGaming
Посмотреть сообщение
Nгo funcionou. Ou seja o texto estб normal

Vinicius: Eae
Sendo q era pra ficar
[ 0 ] [ ADM ] Vinicius: Eae
o Erro n estб ai mбs sim na sua variavel de Admin ^^

fassa um debug e comprove

pawn Код:
//Onplayertext
printf("DEBUG: Valor Admin do ID: %d, й %d", playerid, PInfo[playerid][Level])
e tambйm poste a callback "Fora"


Re: ChatGlobal - eNtinityGaming - 19.02.2014

n tem nada de erro na variavel kara...