[Help] Finding the X,Y from an object
#1

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?
Reply
#2

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

Have you tried GetObjectPos ?
Reply
#4

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.
Reply
#5

*Bump*

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

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

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.
Reply
#8

Then you were already told...

GetPlayerObjectPos (Click it)
Reply
#9

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..
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)