SA-MP Forums Archive
[Help] Finding the X,Y from an object - 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: [Help] Finding the X,Y from an object (/showthread.php?tid=104486)



[Help] Finding the X,Y from an object - RyDeR` - 24.10.2009

Hello, I have a cannon object. When I type for ex. /fire it will fire, but It fire's in different places :S How to find the x,y from these objects? Anybody an Idea?


Re: [Help] Finding the X,Y from an object - thuron - 24.10.2009

if it is an fs, just search for different coцrdinats, and see where it is.


Re: [Help] Finding the X,Y from an object - dice7 - 24.10.2009

Have you tried GetObjectPos ?


Re: [Help] Finding the X,Y from an object - RyDeR` - 24.10.2009

Quote:
Originally Posted by thuron
if it is an fs, just search for different coцrdinats, and see where it is.
Can't actually understand what you mean

Quote:
Originally Posted by dice7
Have you tried GetObjectPos ?
I create the object like this

pawn Код:
CreatePlayerObject(playerid, 3267, pX + (3.9212456678* floatsin(-pA, degrees)), pY + (3.9212456678* floatcos(-pA, degrees)), pZ-1.5, 0, 0 , pA);
Then I have a command. ex. /fire I do CreateExplosion, but the explosion will create in different places I where i set tha cannon.. I also set the cannon with a command.


Re: [Help] Finding the X,Y from an object - RyDeR` - 25.10.2009

*Bump*

No one who know, how to find the X,Y from an object?


Re: [Help] Finding the X,Y from an object - Adamrcook - 25.10.2009

Not quite following what you're asking for.
Explain it better please.


Re: [Help] Finding the X,Y from an object - RyDeR` - 25.10.2009

Quote:
Originally Posted by ╔Jigsaw╗
Not quite following what you're asking for.
Explain it better please.
How can I explain it otherwise? :S

I just want the X, Y from an object.


Re: [Help] Finding the X,Y from an object - Adamrcook - 25.10.2009

Then you were already told...

GetPlayerObjectPos (Click it)


Re: [Help] Finding the X,Y from an object - RyDeR` - 25.10.2009

Quote:
Originally Posted by ╔Jigsaw╗
Then you were already told...

GetPlayerObjectPos (Click it)
I know this and I don't mean this.

This is for getting the X,y from a player.
Код:
stock GetXYInFrontOfPoint(Float:x,Float:y,&Float:x2,&Float:y2,Float:A,Float:distance)
{
x2 = x + (distance * floatsin(-A,degrees));
y2 = y + (distance * floatcos(-A,degrees));
}
I want to get it from an object?

Understand..


Re: [Help] Finding the X,Y from an object - Adamrcook - 25.10.2009

It's getting the position of a OBJECT. Not a player. Read the command.

If the object was created with CreatePlayerObject use GetPlayerObjectPos(playerid, objectid, x, y, z);

If the object was created with CreateObject use GetObjectPos(objectid, x, y, z);