04.11.2014, 19:53
So I was trying to make a local client message function, similar to the ones RP servers to use to create a local chat however its not working and will not display any messages, I have no idea why.
Here is the function:
And here is an example usage (uses ZCMD):
If someone could point out where I went wrong and fix it so I don't make the same mistake again, it will be much appreciated.
Here is the function:
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(IsPlayerConnected(i) && i != playerid)
{
if(IsPlayerInRangeOfPoint(i, dist, ppos[0], ppos[1], ppos[2]))
{
SendClientMessage(i, color, str);
}
}
}
}
return 1;
}
pawn Код:
CMD:test(playerid, params[])
{
SendLocalClientMessage(playerid, 30.0, COLOR_GREY, "If you see this message, \"SendClientLocalMessage\" works");
return 1;
}