SA-MP Forums Archive
[Ajuda] Como colocar nivel ADM na tag do xat - 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] Como colocar nivel ADM na tag do xat (/showthread.php?tid=376341)



Como colocar nivel ADM na tag do xat - focaximubh - 09.09.2012

Olб fiz um cуdigo aqui e gostaria de saber se tem como colocar o nнvel de adm na tag tipo lб estб Focaximubh[ID:0][ADM] diz: sdsasadsd
gostaria que ficasse Focaximubh[ID:0][ADM-5]diz: sadasdasds ou seja gostaria que aparecesse o nнvel de adm no respectivo player poderiam me ajudar? Ai estб o cуdigo do meu OnPlayerCommandText


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

if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM]{FFFFFF}diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}

if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
Espero que me ajudem, agradeзo desde jб (OBS:: exites 2 pois como no meu caso ali quero que adm fique com tag e player nгo o if (APlayerData[playerid][PlayerLevel] <= 0) й para player e o if (APlayerData[playerid][PlayerLevel] >= 1) й para ADM's)


Re: Como colocar nivel ADM na tag do xat - Coreia - 09.09.2012

pawn Код:
new text[50];
          if(APlayerData[playerid][PlayerLevel] == 1) text =  "Moderador";
          if(APlayerData[playerid][PlayerLevel] == 2) text = "Cargo;
          ai vai indo

ai vc adiciona %s no format e poe texto no final '-' Grato


Re: Como colocar nivel ADM na tag do xat - focaximubh - 09.09.2012

Quote:
Originally Posted by Coreia
Посмотреть сообщение
pawn Код:
new text[50];
          if(APlayerData[playerid][PlayerLevel] == 1) text =  "Moderador";
          if(APlayerData[playerid][PlayerLevel] == 2) text = "Cargo;
          ai vai indo

ai vc adiciona %s no format e poe texto no final '-' Grato
Perdгo nгo entendi...


Re: Como colocar nivel ADM na tag do xat - Coreia - 09.09.2012

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

if (APlayerData[playerid][PlayerLevel] >= 1)
{
new texto[20];
if (APlayerData[playerid][PlayerLevel] == 1) texto= "Moderador";
if (APlayerData[playerid][PlayerLevel] == 2) texto = "Auxiliar";
if (APlayerData[playerid][PlayerLevel] == 3) texto= "Nome";
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}Cargo[%s]{FFFFFF}diz: %s", pname, playerid,texto, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}

if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}



Re: Como colocar nivel ADM na tag do xat - StreetGT - 09.09.2012

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

if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid, APlayerData[playerid][PlayerLevel],text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}

if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}



Re: Como colocar nivel ADM na tag do xat - Jason` - 09.09.2012

Otimizando um pouco

pawn Код:
public OnPlayerText(playerid, text[]) {
    static
        string[128],
        name[24];
       
    GetPlayerName(playerid, name, sizeof name);
    if(APlayerData[playerid][PlayerLevel] < 1)
        format(string, sizeof(string), "%s [ID: %i] diz: %s", name, playerid, text);
    else
        format(string, sizeof(string), "%s [ID: %i] [ADM - %i] diz: %s", name, playerid, APlayerData[playerid][PlayerLevel], text);
       
    SendClientMessageToAll(GetPlayerColor(playerid), string);
    return 0;
}



Re: Como colocar nivel ADM na tag do xat - focaximubh - 09.09.2012

Obrigado a todos que ajudaram, acabei vendo os cуdigos e pensei em uma forma melhor de usa-lo:

Atualizando a minha variбvel de acordo com meu sv
pawn Код:
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid,APlayerData[playerid][PlayerLevel], text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}



if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
Agradeзo novamente a todos.


Re: Como colocar nivel ADM na tag do xat - GabrielRibeiro - 27.05.2014

Quote:
Originally Posted by focaximubh
Посмотреть сообщение
Obrigado a todos que ajudaram, acabei vendo os cуdigos e pensei em uma forma melhor de usa-lo:

Atualizando a minha variбvel de acordo com meu sv
pawn Код:
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid,APlayerData[playerid][PlayerLevel], text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}



if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
Agradeзo novamente a todos.
pawn Код:
if (APlayerData[playerid][PlayerLevel] == 0)



Re: Como colocar nivel ADM na tag do xat - Matheus0811 - 12.06.2014

Atualizando
PHP код:
    SetPlayerChatBubble(playeridtextVermelho50.010000);
       if(
dini_Int(file,"Admin") == 1)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}MOD{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
           if(
dini_Int(file,"Admin") == 2)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUPERMOD{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
           if(
dini_Int(file,"Admin") == 3)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}ADM{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
           if(
dini_Int(file,"Admin") == 4)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUBDONO{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
           if(
dini_Int(file,"Admin") == 5)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}DONO{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
    
    if(
dini_Int(file,"VIP") == 1)
    {
        new 
stringv[128];
        new 
pname[MAX_PLAYER_NAME];
        
GetPlayerName(playerid,pname,sizeof(pname));
        
format(stringvsizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}VIP{00FF00}]{00FFFF} %s",pname,playerid,text);
        
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 
0;
    }
    if(
Chatlb == 1)
    {
        
format(stringsizeof(string), "[ID: %d] {00FF00}[{FF0000}JOGADOR{00FF00}]{00FFFF} %s"playeridtext);
        
SendPlayerMessageToAll(playeridstring);
    }
    else
    {
        
ChatProximo(playeridtext);
    }
    return 
0;

Vlw


Re: Como colocar nivel ADM na tag do xat - TheEndGamer - 05.02.2016

Mano eu coloquei isso e nгo funcionou, aparece minha tag antiga [ADM] e nгo aparece a nova e eu substitui a minha tag antiga alguem me ajuda pf.



Код:
    SetPlayerChatBubble(playerid, text, Vermelho, 50.0, 10000);
  		if(dini_Int(file,"pAdmin") == 1)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}MOD{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }
    	if(dini_Int(file,"pAdmin") == 2)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUPERMOD{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }
    	if(dini_Int(file,"pAdmin") == 3)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}ADM{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }
    	if(dini_Int(file,"pAdmin") == 4)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUBDONO{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }
    	if(dini_Int(file,"pAdmin") == 5)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}DONO{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }

    if(dini_Int(file,"VIP") == 1)
    {
        new stringv[128];
        new pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}VIP{00FF00}]{00FFFF} %s",pname,playerid,text);
        SendClientMessageToAll(GetPlayerColor(playerid),stringv);
        return 0;
    }

    if(Chatlb == 1)
    {
        format(string, sizeof(string), "[ID: %d] {00FF00}[{FF0000}JOGADOR{00FF00}]{00FFFF} %s", playerid, text);
        SendPlayerMessageToAll(playerid, string);
    }
    else
    {
        ChatProximo(playerid, text);
    }
    return 0;
}