[Ajuda] Poblema
#1

Galera tou com um poblema, eu coloquei o [ID] na frente do [NICK] mais quando estou no server e falo alguma coisa fica assim exemplo : (amiguinho[ID:1]diz:hauhau) mais eu queria um espaзo entre o nick eo [id:1] vou fazer outro exemplo: (amiguinho [id:0]diz:hauhau) tbm queria q essa parte [ID:1] foзe branco.
eu tenho aki o projeto vou mostrar .

public OnPlayerText(playerid, text[])
{
// Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he's still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");

// Don't allow his text to be sent to the chatbox
return 0;
}
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]:{FFFFFF} %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
// Block the player's text if he has been muted
    if (APlayerData[playerid][Muted] == true)
{
// Let the player know he's still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");

// Don't allow his text to be sent to the chatbox
return 0;
}
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s{FFFFFF}[ID:%d]: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
https://sampforum.blast.hk/showthread.php?tid=372148 - Leia isso, seus conhecimentos de pawn, sгo praticamente nulos...
Reply
#3

No seu cуdigo, troque isto :


pawn Код:
format(string, sizeof(string), "%s[ID:%d]:{FFFFFF} %s", pname, playerid, text);

Por:


pawn Код:
format(string, sizeof(string), "%s {FFFFFF}[ID:%d]{%x}: {FFFFFF}%s", pname, playerid, GetPlayerColor(playerid) >>> 8, text);


Espero ter ajudado .
Reply
#4

Quando eu digito alguma coisa multiplica 2x exemplo: (amiguinho[ID:0]diz:hauahua) (amiguinho diz: hauhau) aparece duas vezes quando falo alguma coisa no chat .
Reply
#5

Troca a sua callback OnPlayerText por esta:

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(APlayerData[playerid][Muted] == true) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s{FFFFFF}[ID:%d]: %s", pname, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
    return 0;
}
Reply
#6

Douglas , de todo jeito retornaria 2 textos , eu acho , porque estб retornando verdadeiro (true) ...

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(APlayerData[playerid][Muted] == true) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s{FFFFFF}[ID:%d]: %s", pname, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
    return 0;//talvez assim retornaria apenas 1 msg...
}
Reply
#7

Quote:
Originally Posted by darkxdll
Посмотреть сообщение
Douglas , de todo jeito retornaria 2 textos , eu acho , porque estб retornando verdadeiro (true) ...

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(APlayerData[playerid][Muted] == true) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s{FFFFFF}[ID:%d]: %s", pname, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
    return 0;//talvez assim retornaria apenas 1 msg...
}
Eu coloquei return 1, mas retifiquei para 0 logo em seguida amigo
Reply
#8

Ah sim . Nгo tinha atualizado aqui kkkk'.
Reply
#9

public OnPlayerText(playerid, text[])
{
// Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he's still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");

// Don't allow his text to be sent to the chatbox
return 0;
}
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s {FFFFFF}[ID:%d]{%x}: {FFFFFF}%s", pname, playerid, GetPlayerColor(playerid) >>> 8, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;

olha como ta o meu, mais msm assim fica 2 texto.
Reply
#10

Quote:
Originally Posted by Natan_silva
Посмотреть сообщение
public OnPlayerText(playerid, text[])
{
// Block the player's text if he has been muted
if (APlayerData[playerid][Muted] == true)
{
// Let the player know he's still muted
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");

// Don't allow his text to be sent to the chatbox
return 0;
}
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s {FFFFFF}[ID:%d]{%x}: {FFFFFF}%s", pname, playerid, GetPlayerColor(playerid) >>> 8, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 1;

olha como ta o meu, mais msm assim fica 2 texto.
Natan, voce nгo entende nada do que estб fazendo... -.-' Se nгo sabe introduzir um simples cуdigo na Public OnPlayerText... entгo meu amigo, eu acho que deveria parar de brincar aos Scripters e ler alguns tutoriais...

Use o cуdigo que eu e o dark ja providenciamos...

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(APlayerData[playerid][Muted] == true) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[INFO]Vocк ainda esta mudo!");
    new string[256], pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "%s{FFFFFF}[ID:%d]: %s", pname, playerid, text);
    SendClientMessageToAll(GetPlayerColor(playerid), string);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)