Send 2 times ?
#1

Hello,

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);
        }
    }
}
Reply
#2

make

pawn Code:
return 0; // this will cancel message
replace

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 0;
}
Reply
#3

Thx alot. My mistake yes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)