[Help] Near messages.
#1

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!
Reply
#2

Код:
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;
}
Reply
#3

Thanks @Ralfie !
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)