SA-MP Forums Archive
How to make menu pop up when player is in range of point - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make menu pop up when player is in range of point (/showthread.php?tid=117508)



How to make menu pop up when player is in range of point - JoeDaDude - 31.12.2009

Im using the new SAMP 0.3 Function,
And i want to make it, So when i go in range of point,
It checks to see if im rcon or an admin, And if i am,
A Menu pops up, And a message is sent using SendClientMessage,
But when im in range of point, It spams the chat with that message,
How do i stop that? You understand what i want


Re: How to make menu pop up when player is in range of point - jamesb93 - 31.12.2009

Make sure it's not returned as "0" and then paste it here.


Re: How to make menu pop up when player is in range of point - Rac3r - 31.12.2009

Код:
new InRangePlayer[MAX_PLAYERS];
Add another check:
Код:
InRangePlayer[playerid]==0 && IsPlayerInRangeOfPont(playerid,range,x,y,z)
If in range:
Код:
InRangePlayer[playerid]=1;
If not in range:
Код:
InRangePlayer[playerid]=0;
Код:
if(InRangePlayer[playerid]==0 && IsPlayerInRangeOfPont(playerid,range,x,y,z))
{
  InRangePlayer[playerid]=1;
  //sendmessage
}
else
{
  InRangePlayer[playerid]=0;
}