help with Range Chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with Range Chat (
/showthread.php?tid=302841)
help with Range Chat -
[LSG]Lil_Familie - 10.12.2011
ok i got a probelm i made the Range "50" so its a local chat but i dont know why the ppl still can talk as example from LV to LS the range didnt changed its no local chat
PHP код:
public Chat_LocalRange(playerid, color, string[])
{
new Float: mPlayerX, Float: mPlayerY, Float: mPlayerZ;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(playerid, mPlayerX, mPlayerY, mPlayerZ);
if(IsPlayerInRangeOfPoint(i, 50, 50, 50, 50))
{
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
{
SendClientMessage(i, COLOR_WHITE, string);
}
}
}
}
return 1;
}
or did i changed the range in the wronge part?
Re: help with Range Chat -
MadeMan - 10.12.2011
pawn Код:
if(IsPlayerInRangeOfPoint(i, 50, mPlayerX, mPlayerY, mPlayerZ))
You should also return 0 in OnPlayerText to block the global chat.
AW: help with Range Chat -
[LSG]Lil_Familie - 11.12.2011
but when i do i cant write anymore only PM's
Re: help with Range Chat -
MadeMan - 11.12.2011
Where do you use this Chat_LocalRange ?
AW: help with Range Chat -
[LSG]Lil_Familie - 11.12.2011
u putted it at the end of my script
Respuesta: help with Range Chat -
PHudson - 11.12.2011
I think it's easier to use function
pawn Код:
LimitGlobalChatRadius(Float:radius);
under
https://sampwiki.blast.hk/wiki/LimitGlobalChatRadius
Let me know if this solved your problem.
AW: help with Range Chat -
[LSG]Lil_Familie - 18.12.2011
thanks it helped very well