Is there a better way to lock a specific door then this?

I’m making a bank robbery script and the only thing I’ve found about locking a door is 3 options and 2 of them don’t work

This works:

BankDoor = GetClosestObjectOfType(262.1981, 222.5188, 106.4296, 100.0, 746855201, 0, 0, 0)
		FreezeEntityPosition(BankDoor, IsLocked)

these do not work:

DoorControl(746855201, 262.1981, 222.5188, 106.4296, IsLocked, 0.0, 50.0, 0)

And:

SetStateOfClosestDoorOfType(746855201, 262.1981, 222.5188, 106.4296, IsLocked, 0, 0)

I will be very grateful if someone has a better way!
Cheers