SA-MP Forums Archive
Function EditObject - 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: Function EditObject (/showthread.php?tid=567565)



Function EditObject - Garwan50 - 14.03.2015

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 !


Re: Function EditObject - JaKe Elite - 14.03.2015

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?


Re: Function EditObject - Smileys - 14.03.2015

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.



Re : Function EditObject - Garwan50 - 15.03.2015

Thanks for your quick answers !

I was'nt aware of the OnPlayerEditObject callback !

Solved thanks to you.