[Ajuda] OnPlayerText...
#1

Olб, quando vou enviar mensagem no chat, envia o meu nick na cor padrгo e outra vez meu nick na cor branca com a tag e o texto.

Exemplo:
Matteus: Matteus[NB]: voevokge

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

    new sText[128];
    GetPlayerColor(playerid);
   
    if((GetPlayerScore(playerid) >= -20000) && (GetPlayerScore(playerid) <= 20000))
    {
        format(sText,sizeof(sText), "%s{FFFFFF}[{FFFF00}NB{FFFFFF}]: %s",Nome(playerid), text);
    SendPlayerMessageToAll(playerid,sText);
        return 0;
    }
    [...]
    return 0;
}
Algo estб errado?
Reply
#2

PHP код:
public OnPlayerText(playeridtext[]) {
    new 
sText[128];
    
GetPlayerColor(playerid);
    
    if((
GetPlayerScore(playerid) >= -20000) && (GetPlayerScore(playerid) <= 20000))
    {
        
format(sText,sizeof(sText), "{%06x}%s{FFFFFF}[{FFFF00}NB{FFFFFF}]: %s",GetPlayerColor(playerid) >>> 8Nome(playerid), text);
    
SendPlayerMessageToAll(playerid,sText);
        return 
0;
    }
    [...]
    return 
0;

Reply
#3

Removido.
Reply
#4

Troque SendPlayerMessageToAll por SendClientMessageToAll.

https://sampwiki.blast.hk/wiki/SendPlayerMessageToAll
https://sampwiki.blast.hk/wiki/SendClientMessageToAll
Reply
#5

Se eu trocar todos os nicks ficam pretos.
Reply
#6

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

    new sText[128];
	
    if((GetPlayerScore(playerid) >= -20000) && (GetPlayerScore(playerid) <= 20000))
    {
        format(sText,sizeof(sText), "%s{FFFFFF}[{FFFF00}NB{FFFFFF}]: %s",Nome(playerid), text);
	SendClientMessageToAll(GetPlayerColor(playerid),sText);
        return 0;
    }
    [...]
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)