Help regarding a function I made.
#4

Hello Josh23761
Instead of the codes above, you could use the next code to avoid several 'ifs' that aren't really necessary and don't have the 'bug' of double messages
Both of above are wrong because if you use return in the message the function will end only with a message
pawn Код:
stock SendLocalClientMessage(playerid, Float:dist, color, str[])
{
    new Float:ppos[3];
    GetPlayerPos(playerid, ppos[0], ppos[1], ppos[2]);
    foreach(Player, i)//I'm not sure what foreach are you using because the foreach of ****** that I use is a little different, and it doesn't need use the 'if(IsPlayerConnected(i))'
    {
                if(IsPlayerInRangeOfPoint(i, dist, ppos[0], ppos[1], ppos[2]))
                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: 2 Guest(s)