02.10.2016, 21:57
ai galera, queria por aquelas id dos jogadores " [0]: etc" antes do nick da pessoa, como faзo isso?
IsPlayerSpawned(playerid){
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"%s: {FFFFFF}(%i) : %s",string,text[0],playerid); SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;}
if(ServerInfo[MustLogin] == 1 && PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 0)
{
SendClientMessage(playerid,red,"Vocк nгo estб logado!");
return 0;
}
PHP Code:
|
new pText[144];
format(pText, sizeof (pText), "[%d]: %s", playerid, text);
SendPlayerMessageToAll(playerid, pText);
public OnPlayerText(playerid, text[]) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s[%i]: %s",name, playerid, text); SendClientMessage(playerid, -1,string); return false; }
Caso queria quando o player falar, coloque isso dai
Ex: Code:
public OnPlayerText(playerid, text[]) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "%s[%i]: %s",name, playerid, text); SendClientMessage(playerid, -1,string); return false; } |
public OnPlayerText(playerid, text[]) { static pName[MAX_PLAYER_NAME],string[256];GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[%d]: %s: %s",playerid,pName, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; }
O Code dele ta errado usa este
Code:
public OnPlayerText(playerid, text[]) { static pName[MAX_PLAYER_NAME],string[256];GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[%d]: %s: %s",playerid,pName, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } |
O Code dele ta errado usa este
Code:
public OnPlayerText(playerid, text[]) { static pName[MAX_PLAYER_NAME],string[256];GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[%d]: %s: %s",playerid,pName, text); SendClientMessageToAll(GetPlayerColor(playerid), string); return 0; } |
Muda a cor do seu nick aqui
este code esta mais melhor para ser usado o nick e a menssagem terгo cores deferentes Code:
public OnPlayerText(playerid, text[]) { static pName[MAX_PLAYER_NAME],string[256],Cor[12]; format(Cor, sizeof(Cor), "%s",GetPlayerColor(playerid)); GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "{FFFF00}[%d]: {"#Cor"} %s:{FFFFFF} %s",playerid,pName, text); SendClientMessageToAll(-1, string); return 0; } |
static pName[MAX_PLAYER_NAME],string[256]; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[%d]: %s:{FFFFFF} %s",playerid,pName, text); SendClientMessageToAll(GetPlayerColor(playerid), string);
Testa ai
Code:
static pName[MAX_PLAYER_NAME],string[256]; GetPlayerName(playerid, pName, sizeof(pName)); format(string, sizeof(string), "[%d]: %s:{FFFFFF} %s",playerid,pName, text); SendClientMessageToAll(GetPlayerColor(playerid), string); |