Пробуй мой:
PHP код:
public OnPlayerText(playerid, text[])
{
if(text[0] == "!")
{
new Float: t_pos_x, Float: t_pos_y, Float: t_pos_z,str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerPos(playerid, t_pos_x, t_pos_y, t_pos_z);
format(str, 128, "[!]%s[%d]: %s", name, playerid, text[1]);
for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 20.0, t_pos_x, t_pos_y, t_pos_z)) SendClientMessageToAll(-1, str);
}
else
{
new Float: t_pos_x, Float: t_pos_y, Float: t_pos_z,str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerPos(playerid, t_pos_x, t_pos_y, t_pos_z);
format(str, 128, "[R]%s[%d]: %s", name, playerid, text);
for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 20.0, t_pos_x, t_pos_y, t_pos_z)) SendClientMessage(i,-1, str);
}
return 0;
}
- - - Добавлено - - -
Ошибочка,вот исправил:
PHP код:
public OnPlayerText(playerid, text[])
{
new Float: t_pos_x, Float: t_pos_y, Float: t_pos_z,str[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerPos(playerid, t_pos_x, t_pos_y, t_pos_z);
if(text[0] == "!")
{
format(str, 128, "[!]%s[%d]: %s", name, playerid, text[1]);
SendClientMessageToAll(-1, str);
}
else
{
format(str, 128, "[R]%s[%d]: %s", name, playerid, text);
for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 20.0, t_pos_x, t_pos_y, t_pos_z)) SendClientMessage(i,-1, str);
}
return 0;