Checks - 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: Checks (
/showthread.php?tid=277932)
Checks -
Machida - 19.08.2011
How do i check if the player is on certain area, or gang area..And also how do i check if the player is close to another..
Is there easy ways , or i will need to do something like ..
if(XPos == EnemyXPos && YPos == EnemyYPos .................
something like that idk
Re: Checks -
Machida - 19.08.2011
hmm Yeah thanks, (You added X instead of Y xDD)
i got it.
But now can you explain me how to check if another player(s) is close to you ? like to make an command /cuff i will need to know the distance...
So i guess i need to make a square around the player that i want to check if its close..
Please clarify. ^^
Re: Checks -
Machida - 20.08.2011
IsPlayerInRangeOfPoint(Enemy ID , The Distance i want, EnemyX, EnemyY, EnemyZ);
Something like that right?
PS: "The Distance i want" is in meters, or what xD , Thanks for helping you are very helpful!
Re: Checks -
Machida - 20.08.2011
...Wait..
Player ID, Its me right? If yes now i get it.
the X,Y,Z its the location of one who i want to check the distance to me (sorry my bad english)
amiright?
Like:
if(
IsPlayerInRangeOfPoint(playerid/*ME*/,50/*Range*/,EnemyX,Y,Z) ) cuff(cuff someone);
just an example.
Re: Checks -
Machida - 20.08.2011
Thank you alot! You are very helpful.
i wish you luck with your projects!