10.08.2016, 05:48
Hello, I have attached a safe door to a safe, and made a code to move the safe door (open it), I tried to use the command ingame, but no changes and the safe door didnt move. I'm 100 percent sure about the code.
AttachObjectToObject(x, a, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); //after say 100ms i do this : AttachObjectToObject(x, a, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0); //after say 200ms i do this : AttachObjectToObject(x, a, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0); //after say 300ms i do this : AttachObjectToObject(x, a, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0) |
You need to move the object using https://sampwiki.blast.hk/wiki/AttachObjectToObject itself
for example i want to move a object id say 'x' which is attached to object id 'a', I will do this : This will move object slowly upwards. EDIT: A more easy approach would be to not attach object and move it via MoveObject(). You can add offset to safe position and then use that as door position to place it correctly without using AttachObjectToObjcet(). |
SyncRotation If set to 0, objectid's rotation will not change with attachtoid's. |
SetObjectPos(doorObject, safePos_x + offset_x, safePos_y + offset_y,..........);//u know where its going //for moving: MoveObject(doorObject, ..);