[Ayuda] Ids antes del nick
#1

He visto Servidores en donde las Ids aparecen antes del nick en el Chat, he buscado algun scripts pero no encuentro u.u Tengo como la idea de saber como se hace pero no me sale :S
Me pasan el link de donde ta posteado eso? o pasenmen el scripts aqui, lo necesito :C

Ejemplo:
Normal: dannypanda05: [3]: hola .-.
Como lo quiero: [3] dannypanda05: hola .-.
Reply
#2

Код:
public OnPlayerText(playerid, text[])
{
    new Texto[128], Nombre[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nombre, sizeof (name));
    format(Texto, sizeof (Texto), "[%d] %s: %s", playerid, Nombre, text);
    SendPlayerMessageToAll(playerid, Texto);
    return 0;
}
Probб asн
Reply
#3

Simple, se crean 2 arrays, usas GetPlayerName, format, SendPlayerMessageToAll y listo:

pawn Код:
public OnPlayerText(playerid, text[]) //Cuando el jugador inserte X texto
{
    new Texto[128], Nombre[21]; //Los 2 arrays
    GetPlayerName(playerid, Nombre, sizeof (Nombre)); //Almacenamos el nombre del jugador en el array "Nombre"
    format(Texto, sizeof(Texto), "[%d] %s: %s", playerid, Nombre, text); //Hacemos un format con el destino "Texto", con la ID, el nombre y el texto del jugador.
    SendPlayerMessageToAll(playerid, Texto); //Le enviamos el mensaje a todos
    return 0; //IMPORTANTE para esta ocasiуn, si retornamos 0, el mensaje por default NO ES ENVIADO, asн no aparecerбn 2 mensajes al mismo tiempo.
}
NOTA: Todo lo que estб detrбs del texto, serб del color del jugador.

Resultado:
[0] Edugta: Hola

Edit: Holy Shit! EnzoMetlc me ganу
Reply
#4

No saldrнa ._. Ps me saldrнa el nick x defecto, o sea asi:

dannypanda05: [3] dannypanda05: hola .-.
Reply
#5

Tienes que usar SendClientMessageToAll, SendPlayerMesageToAll lo envia ya con el nick.
Reply
#6

pawn Код:
public OnPlayerText(playerid, text[])
{
    static mensaje[198], nombre[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nombre, sizeof(nombre));
    format(mensaje, sizeof(mensaje), "[%i]{%06x} %s:{ffffff}%s", playerid, GetPlayerColor(playerid) >>> 8, nombre, text);
    SendClientMessageToAll(-1, mensaje);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)