SA-MP Forums Archive
Question. - 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: Question. (/showthread.php?tid=351856)



Question. - Edin Black - 17.06.2012

Hello.

Who I make when a player is in range of pint, exaple: spawn and when he have a gun, he get disarmed ?

Sorry for my bad english.


Re: Question. - Kindred - 17.06.2012

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z))
{
    //Code that happens if they are in range of point
}
else
{
   //Code that happens if they are not in range of point
}
This checks if a player is in range of a point. If you want the server to check if the player is near a point every certain amount of seconds, use a timer, or use OnPlayerUpdate, which is called nearly 20 times a second (if not incorrect).