31.10.2011, 08:52
(
Последний раз редактировалось V4at; 31.10.2011 в 10:57.
)
How to make PlayerID near player nick in chat?
new
szStr[128],
szPName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szPName, MAX_PLAYER_NAME);
format(szStr, sizeof(szStr), "{4169FF}%s:{FFFFFF} %s", szPName, text[0]);
for(new i; i < MAX_PLAYERS; i++)//if you use foreach use that, if you don't - then you should start.
if(IsPlayerConnected(i))
SendClientMessageToAll(COLOR_WHITE,szStr);
format(szStr, sizeof(szStr), "{4169FF}%s(%i):{FFFFFF} %s", szPName, playerid,text[0]);
pawn Код:
|
public OnPlayerText(playerid, text[]) {
new
cString[128],
pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(cString, sizeof(cString), "%s(%d): %s", pName, playerid, text);
SendClientMessageToAll(-1, cString);
return 0;
}
I don't believe so, it's copied from my GM, where it works...
|
public OnPlayerText(playerid, text[]) {
new
cString[128],
pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(cString, sizeof(cString), "%s(%d){FFFFFF}: %s", pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), cString);
return 0;
}
public OnPlayerText(playerid, text[]) {
new
cString[128],
pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(cString, sizeof(cString), "%s(%d): {FFFFFF}%s", pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), cString);
return 0;
}