Trying to lock a building door

Hi,

I’m trying to lock a building door, but i can’t get it to work. Ifsomeone could point me into the right direction …

i’m using : FreezeEntityPosition(“1557126584”, true) and also tried it with the object name instead of the hash id with no success.

That is not a local entity id.

The object id that you find here: [http://objects.codeshock.hu/gallery.php?page](http://)

is just a “model” id. So those two things are not the same.

You should check for the closest object around you in a loop with the exact model id (1557126584) and then you should use the local id of the object to freeze it.

This function should help you with the code:
https://runtime.fivem.net/doc/reference.html#_0x8ACD366038D14505

Gotcha, thanks a lot got it working now

Also, you might want to rethink the locking code. The door could be angled when the player locks the door and it would stay like that until it is unlocked. You need to check if the door is closed (in it’s primary position).

How do I do it? I need to find this object ID: 2061060

Not sure how to do it though.