14.06.2013, 13:28
Hello,
Im little bit counfused is this is bug or smth. Why OnPlayerText send 2 times SenDClientMessage?
Im little bit counfused is this is bug or smth. Why OnPlayerText send 2 times SenDClientMessage?
pawn Code:
public OnPlayerText(playerid, text[])
{
format(g_String,sizeof(g_String),"%s ьtleb: %s",returnNameEx(playerid),text);
ProxDetector(20.0, playerid, g_String, COLOR_GREY);
return 1;
}
stock ProxDetector(Float:radi, playerid, stringg[], color)
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(playerid, posx, posy, posz);
foreach (Player, i)
{
if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
{
if(IsPlayerInRangeOfPoint(i,radi,posx, posy, posz))
{
SendClientMessageTwoRows(i, color, stringg);
}
}
else
{
SendClientMessageTwoRows(i, color, stringg);
}
}
}