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



Script Related Question-Position - Sarra - 01.08.2014

Hi, I Just started Learning scripting, I started with easy commands like /fixveh, /nos...I'm Adding a /repair command, But I need the player to be in a specific location, So I wonder how Can I do that? Exp: I want to verify if the player is in the mechanic place or 10Meters far, If not he'll get a checkpoint!
So All I want is; Is there any function to verify If the player is at the wanted location or not? I can't find one in Wiki


Re: Script Related Question-Position - Dignity - 01.08.2014

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 10.0, X, Y, Z))
{
// code
}

else SetPlayerCheckpoint(playerid, x, y, z, size);
https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Script Related Question-Position - Sarra - 01.08.2014

thanks!! That's exactly what I've been looking for!