Object 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: Object position (
/showthread.php?tid=449159)
Object position -
RALL0 - 07.07.2013
Hey guys, how can I check if a player is near a defined object, I don't mean by the cooordinates where it's been placed in a mapping tool but actually like you can use it to load the object on a forklift.
Here is an example
pawn Code:
Object[1] = CreateDynamicObject...
CMD:forklift[etc..
Re: Object position -
magnetec - 07.07.2013
PHP Code:
new Float:x,Float:y,Float:z;
GetDynamicObjectPos(Object[1],x,y,z);
if(if(IsPlayerInRangeOfPoint(i,1,xy,z)){
//Object near the player
}
Re: Object position -
RALL0 - 07.07.2013
That was exactly what I was looking for, thanks.