Nearly 2 years ago, I found out an ugly way to do such thing:
| CODE |
{$CLEO}
0000: NOP
while true wait 0 if 00DF: actor $PLAYER_ACTOR driving then if 00E1: player 0 pressed_key 4 // Secondary fire then 03C0: 0@ = actor $PLAYER_ACTOR car 0441: 1@ = car 0@ model 0674: set_car_model 1@ numberplate "_PLATE_" 0AB1: call_scm_func @refreshVehModel 1 vehicle 0@ end end end
:refreshVehModel { Parameters: Passed: 0@ - vehicle (handle) Result: none
Example: 0AB1: call_scm_func @refreshVehModel 1 vehicle 0@ } 0441: 1@ = car 0@ model 0A97: 0@ = car 0@ struct 0AA6: call_method 0x6D6410 struct 0@ num_params 0 pop 0 // CVehicle__DeleteRwObject 0AA6: call_method 0x6A6590 struct 0@ num_params 1 pop 0 sIndex 1@ // CAutomobile__SetModelIndex 0AB2: ret 0 |
Unfortunately, it clears any visible damage cause vehicle's parts get removed and recreated. Vehicle's variations may be affected too. I'm too lazy to fix the script right now.