PDA

View Full Version : [Help] Near messages.


NoDi522
24/03/2015, 12:33 PM
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! :)

Evocator
24/03/2015, 12:45 PM
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;
}

NoDi522
24/03/2015, 12:57 PM
Thanks @Ralfie !

SickAttack
24/03/2015, 01:05 PM
http://forum.sa-mp.com/showthread.php?t=520734

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