Player Object Co-ordinates Help
#1

Hello, I am trying to make a filterscript (Not going to say what for... secret ;3) and I need to find out the co-ordinates of the objects attached to the player sent as a message.

I am currently using "GetPlayerObjectPos" but I'm not quite sure if that's the right thing...

Anyway, here's my current code. Can someone help me?

Код:
command(objectpos, playerid, prams[])
{
	new Float:x, Float:y, Float:z;
	GetPlayerObjectPos(playerid, 19515, x, y, z);
	SendClientMessage(playerid, COLOR_WHITE, "%x");
	SendClientMessage(playerid, COLOR_WHITE, "%y");
	SendClientMessage(playerid, COLOR_WHITE, "%z");
	return 1;
}
Reply
#2

Let me guess...toyz?
Reply
#3

No. It's not a, "Toys", script. I already made one of them. I just need to know how I would find out what the co-ordinates are for when the object is attached to a player.
Reply
#4

may i suggest you to have a look @ GetPlayerObjectPos ?
the id, 19515, is the object model, but its supposed to handle a pointer which contains the (returned) object-placeholder. where:
pawn Код:
BabulsObject=CreateObject(19515,coords etc blabla);
..creates the object model 19515, and assigns the returned value (like a serialized enumerator) to BabulsObject.
getting "my" objects' parameters, is done like you already tried, with a little change in your command:
pawn Код:
//...your command
GetPlayerObjectPos(BabulsObject, 19515, x, y, z);
feel free to change the name of the placeholder, especially adding a
pawn Код:
new BabulsObject[MAX_PLAYERS];
will help you to let each player create an object.
Reply
#5

I think I said this completely wrong. I need to find the co-ordinates of a object attached to a player, sent as a message.
Reply
#6

pawn Код:
command(objectpos, playerid, prams[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerObjectPos(playerid, 19515, x, y, z);
        new Str[100];
    format(Str,100,"X:%f, Y:%f, Z:%f",x,y,z);
        SendClientMessage(playerid,0xFFFFFFFF,Str);
    return 1;
}
Reply
#7

attached objects' (object-to-object + object-to-player) parameters can NOT be obtained from the client. since the parameters are being sent to the client in order to calculate the data there, its your job to care for storing all data, like object id, bone, modelid, position offsets and rotations.
when creating (attaching) the object, make sure that everything gets saved into a server-sided variable (enum/PVar), which can indeed be accessed at anytime later.
Reply
#8

Okay... So it will be impossible for me to create a command, showing the current co-ordinates for the object attached to the player?
Reply
#9

You have to save the coordinate to a variable like PVar or like this:
pawn Код:
enum PObjectCo
{
x,
y,
z
}

new pObject[MAX_PLAYERS][pObjectCo];
Then when you edit the object, save the coordinate here when the player attached the object
Like this:
pawn Код:
x = pObject[playerid][x]
y = pObject[playerid][y]
z = pObject[playerid][z]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)