[Ajuda] Prefixo
#1

Queria saber como posso colocar um Prefixo no chat sу para admins, por exemplo, eu seto admin pra alguem que tem o Nick "Soldado", ai eu uso o /setadmin e fica com o prefixo no chat, "[Admin]Soldado", e queria saber tambem como posso deixar esse prefixo colorido :3 Se alguem puder me ajudar, agradeзo.
Reply
#2

pawn Код:
dini_IntSet(file2, "Admin",1);// cole isso quando ele seta o admin pro player
pawn Код:
public OnPlayerText(playerid, text[])//
{
if(dini_Int(file,"Admin") == 1)
{
format(string, 655, "{00BFFF}[Admin]{FFFAFA}%s [ID %d] diz : %s", aname, playerid, text);
return 1;
}

Cores
http://www.efeitosespeciais.net/tabela.htm

como usar

{ Cor }

exemplo

pawn Код:
{00BFFF}
se nгo for em dini , eu fasso por Dof2 tbm tente se nгo funcionar avise
Reply
#3

Valew manin, vou testar aqui :33

#edit

Nom funcionou ;-; Fiz dessa forma:

pawn Код:
if(strcmp(cmd,"/setadmin", true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerAdmin(playerid)){
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
return 1;
}
skin = strval(tmp);
if(skin>=6){
SendClientMessage(playerid, Vermelho, "(ERRO) O level Permitido para ADM e 0 a 5!");
return 1;
}
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
if(skin>=1){
pAdmin[plid] = skin;
dini_IntSet(file2, "Admin",1); //Codigo que me mandou colar
format(string, sizeof(string), "{FF0000}(INFO){191970}O(A)Dono do server %s (%d) (») Promoveu: %s (%d) {0000FF}para administrador (»){A020F0} Level: %d", aname,playerid,pname,plid,skin);
SendClientMessageToAll(tcadm, string);
}
if(skin == 0){
pAdmin[plid] = 0;
SpawnPlayer(plid);
format(string, sizeof(string), "{FF0000}(INFO) {191970}O Admin Rcon %s (%d) (») {0000FF}Retirou admin do jogador: %s {A020F0}(ID: %d)", aname,playerid,pname,plid);
SendClientMessageToAll(tcadm, string);
}
return 1;
}else{
SendClientMessage(playerid, Violeta, "(ERRO) Jogador nгo conectado.");
return 1;
}
}
}


//Em Public OnPlayerText(playerid, text[])
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new string9[256];
if(dini_Int(file,"Admin") == 1)
{
format(string9, 655, "{00BFFF}[Admin]{FFFAFA}%s [ID %d] diz : %s", aname, playerid, text);
return 1;
}
Reply
#4

desculpa ;s fiz errado

pawn Код:
if(Admin[playerid] == 1)
{
format(string, 655, "{00BFFF}[Admin]{FFFAFA}%s [ID %d] diz : %s", aname, playerid, text);
return 1;
}
Reply
#5

Valew heauheueahueah Testar aqui
Reply
#6

1є - Idente seus cуdigos para melhor compreensгo:

pawn Код:
if(strcmp(cmd,"/setadmin", true)==0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    if(IsPlayerAdmin(playerid))
    {
        new tmp[256];
        new plid, skin;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
            return 1;
        }
        plid = strval(tmp);
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /setadmin [id] [Level]");
            return 1;
        }
        skin = strval(tmp);
        if(skin>=6)
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) O level Permitido para ADM e 0 a 5!");
            return 1;
        }
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(plid, pname, MAX_PLAYER_NAME);
        if(IsPlayerConnected(plid))
        {
            if(skin>=1)
            {
                pAdmin[plid] = skin;
                dini_IntSet(file2, "Admin",1); //Codigo que me mandou colar
                format(string, sizeof(string), "{FF0000}(INFO){191970}O(A)Dono do server %s (%d) (») Promoveu: %s (%d) {0000FF}para administrador (»){A020F0} Level: %d", aname,playerid,pname,plid,skin);
                SendClientMessageToAll(tcadm, string);
            }
            if(skin == 0)
            {
                pAdmin[plid] = 0;
                SpawnPlayer(plid);
                format(string, sizeof(string), "{FF0000}(INFO) {191970}O Admin Rcon %s (%d) (») {0000FF}Retirou admin do jogador: %s {A020F0}(ID: %d)", aname,playerid,pname,plid);
                SendClientMessageToAll(tcadm, string);
            }
        return 1;
        }
        else
        {
            SendClientMessage(playerid, Violeta, "(ERRO) Jogador nгo conectado.");
            return 1;
        }
    }
}
Com este cуdigo, se estiver logado na rcon, vai aparecer [ADMIN] atrбs do nome:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new nome[MAX_PLAYER_NAME];
   
    GetPlayerName(playerid, nome, sizeof(nome);
    if(IsPlayerAdmin(playerid))
    {
        new string[128];
   
        format(string, sizeof(string), "{00BFFF}[Admin]{FFFAFA}%s [ID %d] diz : %s", nome, playerid, text);
   
        SendClientMessageToAll(-1, string);
        return 1;
    }
    else
    {
        new string[128];

        format(string, sizeof(string), "{FFFAFA}%s [ID %d] diz : %s", nome, playerid, text);

        SendClientMessageToAll(-1, string);
        return 1;
        // Texto normal dos players que nгo sгo admins
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)