ID Players -
maxblaya01 - 04.09.2015
queria saber como que fais para por os id dos jogadores na frente das mensagens e quando o player conecta ao servidor.. eu to criando uma gamemode mais tipo so aparece os nicks nao aparece os id dos player.. alguem pode me ajudar nisso..
Re: ID PLAYERS -
[BOPE]Seu._.Madruga - 04.09.2015
Na pъblico OnPlayerText
PHP код:
new string[144], aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format( string, sizeof(string), "[%d] %s diz: %s", playerid, aname, text);
SendClientMessageToAll(-1, string);
Nгo se esqueзa de por returno 0.
Re: ID PLAYERS -
iTakelot - 04.09.2015
use "playerid" '-' para pegar o id como no exemplo :
PHP код:
public OnPlayerConnect(playerid)
{
new string[64], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome,MAX_PLAYER_NAME);
format(string,sizeof string,"%s [ID:%i] Entrou no jogo!",Nome,playerid);// Veja que pegamos o ID do player somente colocando "playerid".
SendClientMessage(0xFFFFFFAA,string);
return 1;
}
Re: ID PLAYERS -
matheusspohr - 04.09.2015
tente:
PHP код:
//public OnPlayerConnect:
new Name[24], MSConnect[128];
GetPlayerName(playerid, Name, 24);
format(MSConnect, 128, "{00FF00}O Jogador {FFFFFF}%s{00FF00} [ID:%d] estб online!", Name, playerid);
SendClientMessageToAll(-1, MSConnect);
Re: ID PLAYERS -
maxblaya01 - 04.09.2015
Quote:
Originally Posted by matheusspohr
tente:
PHP код:
//public OnPlayerConnect:
new Name[24], MSConnect[128];
GetPlayerName(playerid, Name, 24);
format(MSConnect, 128, "{00FF00}O Jogador {FFFFFF}%s{00FF00} [ID:%d] estб online!", Name, playerid);
SendClientMessageToAll(-1, MSConnect);
|
Quote:
Originally Posted by iTakelot
use "playerid" '-' para pegar o id como no exemplo :
PHP код:
public OnPlayerConnect(playerid)
{
new string[64], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,Nome,MAX_PLAYER_NAME);
format(string,sizeof string,"%s [ID:%i] Entrou no jogo!",Nome,playerid);// Veja que pegamos o ID do player somente colocando "playerid".
SendClientMessage(0xFFFFFFAA,string);
return 1;
}
|
Quote:
Originally Posted by [BOPE]Seu._.Madruga
Na pъblico OnPlayerText
PHP код:
new string[144], aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format( string, sizeof(string), "[%d] %s diz: %s", playerid, aname, text);
SendClientMessageToAll(-1, string);
Nгo se esqueзa de por returno 0.
|
certo, mais como eu faзo para aparecer branco so o texto digitado e o nick do player ficar de acordo com a cor do nome dele?
Re: ID PLAYERS -
matheusspohr - 04.09.2015
Daria para utilizar
GetPlayerColor, no inicio da frase apague todas as cores, antes no local que vocк quer a cor coloque: {%06x} e no final, adicione GetPlayerColor(playerid)>>>8. Exemplo:
PHP код:
//public OnPlayerConnect:
new Name[24], MSConnect[128];
GetPlayerName(playerid, Name, 24);
format(MSConnect, 128, "O Jogador {%06x}%s{FFFFFF} [ID:%d] estб online!", GetPlayerColor(playerid)>>>8, Name, playerid);
SendClientMessageToAll(-1, MSConnect);
Re: ID Players -
maxblaya01 - 04.09.2015
Consegui arrumar... se Alguem queser tambem e tar tendo dificuldades ta ae o codigo:
public OnPlayerText(playerid, text[])
{
new string[128];
format( string, sizeof(string), "• [ID: %d] »{FFFFFF} %s", playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}