Function EditObject
#1

Hi,

i'm developping a in game mapping script, a 3d text label appear when an object is created, but when you move it using the EditObject function, it looks like the object has'nt really moved, and the label is still at the same position.
However, using SetObjectPos make the label move with the object.

Is there a way to "fix" EditObject ?
If not, i'll make /rotationx, /rotationy, /rotationz, /posx, /posy, /posz etc, but i'd rather not.

Thanks !
Reply
#2

As far as i know, The object will only move (or update, if that's what you meant) if you press the save button (If you have ever scripted this on your OnPlayerEditObject).

Also, is the 3D Text object attached to the object? Are you using streamer or the regular objects?
Reply
#3

make sure you use OnPlayerEditObject.

as you can see there in the example, it keeps setting the object's position to the position you dragged it to, try doing it for the 3dtextlabel too, it should work just fine

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
Also, is the 3D Text object attached to the object? Are you using streamer or the regular objects?
there's no such function in samp


What you could do is:

pawn Код:
enum E_OBJECT_DATA
{
    E_OBJ_ID,
    E_OBJ_MODELID,
    Text3D:E_OBJ_TEXT
    // the rest of the stuff such as X, Y and Z coords/rots
};

new Objects[ MAX_PLAYERS ][ E_OBJECT_DATA ];

// when object is created
Objects[ playerid ][ E_OBJ_TEXT ] = CreatePlayer3DTextLabel(playerid,"w.e you wanna put here", your_color, X,Y,Z,draw_distance);

// at OnPlayerEditObject
Delete3DTextLabel( Objects[ playerid ][ E_OBJ_TEXT ] );
Objects[ playerid ][ E_OBJ_TEXT ] = CreatePlayer3DTextLabel(playerid,"w.e you wanna put here", your_color, X,Y,Z,draw_distance);
// and the object position updating etc.
Reply
#4

Thanks for your quick answers !

I was'nt aware of the OnPlayerEditObject callback !

Solved thanks to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)