Help regarding a function I made.
#2

you don't want to use "IsPlayerConnected" In Foreach.

try this code:

pawn Код:
SendLocalClientMessage(playerid, Float:dist, color, str[])
{
    if(IsPlayerConnected(playerid))
    {
        new Float:ppos[3];
        GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
        SendClientMessage(playerid, color, str);
        foreach(Player, i)
        {
            if(i != playerid)
            {
                if(IsPlayerInRangeOfPoint(i, dist, ppos[0], ppos[1], ppos[2]))
                {
                    return SendClientMessage(i, color, str);
                }
            }
        }
    }
}
Reply


Messages In This Thread
Help regarding a function I made. - by Josh23761 - 04.11.2014, 19:53
Re: Help regarding a function I made. - by M4D - 04.11.2014, 20:07
Re: Help regarding a function I made. - by RustyXD - 04.11.2014, 23:05
Re: Help regarding a function I made. - by Su37Erich - 05.11.2014, 00:39
[No subject] - by Josh23761 - 05.11.2014, 17:12
Re: Help regarding a function I made. - by dominik523 - 05.11.2014, 17:33
Re: Help regarding a function I made. - by Josh23761 - 05.11.2014, 18:32
Re: Help regarding a function I made. - by Josh23761 - 05.11.2014, 19:29
Re: Help regarding a function I made. - by Josh23761 - 05.11.2014, 22:40
Re: Help regarding a function I made. - by Eth - 05.11.2014, 22:57

Forum Jump:


Users browsing this thread: 1 Guest(s)