SA-MP Forums Archive
[Help] Near messages. - 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] Near messages. (/showthread.php?tid=568706)



[Help] Near messages. - NoDi522 - 24.03.2015

Hello guys!

I need your help. So i wanted to make a stock "SendNearMessage". It should work something like this:

"if is player somewhere in range of other player who texted,let him get that message". I tried to make simple stock using foreach for that but it was unsuccessfull because i got some errors which i couldn't fix.

Thanks for your help!



Re: [Help] Near messages. - Evocator - 24.03.2015

Код:
SendNearMessage(playerid, Float:Disatance, color, message[])
{
	new 
		Float:floatvar[3],
		VW = GetPlayerVirtualWorld(playerid)
	;
	
	GetPlayerPos(playerid, floatvar[0], floatvar[1], floatvar[2]);

	foreach (new i : Player)
	{
		if ( GetPlayerVirtualWorld(i) != VW ) continue;
		if ( IsPlayerInRangeOfPoint(i, Disatance, x, y, z) )
		{
			SendClientMessage(i, color, message);
		}
	}
	return 1;
}



Re: [Help] Near messages. - NoDi522 - 24.03.2015

Thanks @Ralfie !


Re: [Help] Near messages. - SickAttack - 24.03.2015

https://sampforum.blast.hk/showthread.php?tid=520734

That include has it too, but it has more features!