17.05.2014, 13:37
I'm assuming this is what you want.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(!IsPlayerInAnyVehicle(playerid)) ApplyAnimation(playerid,"PED","IDLE_CHAT",4.1,1,1,1,0, (strlen(text) * 200));
SetPlayerChatBubble(playerid, text, (PlayerInfo[playerid][pAdmin]) ? (COL_ADMINGREEN) : (COL_WHITE), 50.0, 4000);
new name[MAX_PLAYER_NAME], string[150], Float:X, Float:Y, Float:Z;
GetPlayerName(playerid, name, sizeof(name));
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), ""TCWHITE"["TCRED"%s"TCWHITE"]: "TCCYAN"%s", name, text[0]);
strreplace(name, '_', ' ');
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 5.0, X, Y, Z)) SendClientMessage(i, (PlayerInfo[playerid][pAdmin]) ? (COL_ADMINGREEN) : (COL_WHITE), string);
}
return 0;
}