I can't test this myself, but I'm pretty sure your mod will lead to unexpected results if used in multiplayer mode because the variables defined at the top of control.lua will be applied to all players. For example, if one player has gear == 4
, this value will also be used for all other players -- even if they are riding in the vanilla car.
You could fix that by storing all of these variables per player in your global table, like this:
global.player_data[player.index = {
gear = x,
turboenable = y,
...,
}
and use these values in your functions.