ID Na frente do nome
#1

Alguйm sabe como colocar o id na frente do nome pra quando for falar? tipo

[ID: 24] Reizer: Bom dia
Reply
#2

Localiza a Public OnPlayerText e coloque esse codigo:

pawn Код:
//public OnPlayerText(playerid, text[])
//Daqui...
{
    new textv2[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof (name));
    format(textv2, sizeof (textv2), "[ID: %d] %s: %s", playerid, name, text);
    SendPlayerMessageToAll(playerid, textv2);
    return 0;
}
//Atй aqui...
Wiki Sa-mp: OnPlayerText

@GetCode
Satisfeito agora?
Citei 'criar' porque olhei no Grandlarc e nгo havia a public.
Criei um novo arquivo pawn e nгo veio a public (que vocк falou ser nativa).
Alйm de nгo saber se o GM dele hб a public OnPlayerText.
Reply
#3

Quote:
Originally Posted by Spectral
Посмотреть сообщение
Cria essa public no fim do GM:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new textv2[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof (name));
    format(textv2, sizeof (textv2), "[ID: %d] %s: %s", playerid, name, text);
    SendPlayerMessageToAll(playerid, textv2);
    return 0;
}
Wiki Sa-mp: OnPlayerText
Criar nгo, pois essa callback ja й nativa do samp, nгo necessita criar novamente, pois isso daria um erro pq ela ja esta criada.
apenas coloque o codigo de dentro das chaves acima, na public OnPlayerText(playerid, text[])
Reply
#4

pawn Код:
public OnPlayertext(playerid,text[])
{
      format(string, sizeof(string), "[ID: %d] %s", playerid, text);
      SendPlayerMessageToAll(playerid, string);
       return 0;
}
Reply
#5

Quote:
Originally Posted by Marlon307
Посмотреть сообщение
pawn Код:
public OnPlayertext(playerid,text[])
        {
            format(string, sizeof(string), "[ID: %d] %s", playerid, text);
            SendPlayerMessageToAll(playerid, string);
            return 0;
        }
E o nome do player atrбs do ID?
Reply
#6

foi mal esqueci disso

pawn Код:
public OnPlayertext(playerid,text[])
{
    new string[200];
    format(string, sizeof(string), PASTA_CONTAS, GetName(playerid));

    format(string, sizeof(string), "[ID: %d] %s", playerid, text);
    SendPlayerMessageToAll(playerid, string);
    return 0;
}

stock GetName(playerid)
{
    new PlayerNameLevel[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYER_NAME);
    return PlayerNameLevel;
}
Reply
#7

Quote:
Originally Posted by Spectral
Посмотреть сообщение
E o nome do player atrбs do ID?
foi mal esqueci disso

pawn Код:
public OnPlayertext(playerid,text[])
{
    new string[200];
    format(string, sizeof(string), PASTA_CONTAS, GetName(playerid));

    format(string, sizeof(string), "[ID: %d] %s", playerid, text);
    SendPlayerMessageToAll(playerid, string);
    return 0;
}

stock GetName(playerid)
{
    new PlayerNameLevel[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerNameLevel, MAX_PLAYER_NAME);
    return PlayerNameLevel;
}
Reply
#8

Quote:
Originally Posted by Marlon307
Посмотреть сообщение
pawn Код:
format(string, sizeof(string), PASTA_CONTAS, GetName(playerid));
Pra que isso? o.O
Reply
#9

Quote:
Originally Posted by ViniBorn
Посмотреть сообщение
Pra que isso? o.O
Nгo prestei atenзгo nisso eu tirei do meu GM mais e sу tirar
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)