A very minor thing:
Where:
TARGET_DATA = server.getAITarget(object_id)
The TARGET_DATA.character and TARGET_DATA.vehicle should be an integer and NOT a float.
Problem:
TARGET_DATA.character and TARGET_DATA.vehicle are floats.
Solution:
TARGET_DATA.character and TARGET_DATA.vehicle should be an integer.
Back in the day, this was bad because the game cared about types.
now it is fine because it still works (most of the time).