AttachObject problems.. -
Cause I've made a nice script but I can't DeAttach the object, and I don't want to delete it because I may want to re-attach it later(and if I destroy the object the pawn won't detect it).
Re: AttachObject problems.. -
It's quite simple, all you need to do is to recreate the object in it's same positions and rotations.
pawn Код:
new object;
object = CreateObject(modelid,x,y,z,rotx,roty,rotz,drawdistance);
AttachObjectToPlayer(object,playerid,stuff here);
//And when you want to de-attach, simply:
new Float:x,Float:y,Float:z,Float:rotX,Float:rotY,Float:rotZ;
GetObjectPos(object,x,y,z);
GetObjectRot(object,rotX,rotY,rotZ);
DestroyObject(object);
object = CreateObject(modelid,x,y,z,rotX,rotY,rotZ,draw_distance);