[Ajuda] Como colocar nivel ADM na tag do xat
#1

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)
Reply
#2

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
Reply
#3

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...
Reply
#4

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;
}
Reply
#5

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;
}
Reply
#6

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;
}
Reply
#7

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.
Reply
#8

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)
Reply
#9

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)