diff options
Diffstat (limited to 'plugins/smoke_on_damage')
| -rw-r--r-- | plugins/smoke_on_damage/Plugin.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/smoke_on_damage/Plugin.py b/plugins/smoke_on_damage/Plugin.py index e6c57e2..08c184b 100644 --- a/plugins/smoke_on_damage/Plugin.py +++ b/plugins/smoke_on_damage/Plugin.py @@ -16,30 +16,30 @@ class Plugin: self.plugin_manager.register_hook('on_weapon_config', self.on_weapon_config) def on_flight_data(self, data, player,message_to_client, message_to_server): - """After the initial incoming flight packet, check whether + """After the initial incoming flight packet, check whether the health is below the threshold, if so add smoke""" - if ENABLED and SMOKE_PLANE and player.aircraft.life<SMOKE_LIFE: - + if SMOKE_PLANE and player.aircraft.life<SMOKE_LIFE: + #Add smoke to the plane smoke_packet = FSNETCMD_AIRPLANESTATE(data).smoke() #forward it on to the server - + message_to_server.append(smoke_packet) - - - + + + if not player.aircraft.damage_engine_warn_sent: player.aircraft.damage_engine_warn_sent = True #Warn the player message = "Your engine has been damaged! You can't turn on your afterburner!" message_to_client.append(FSNETCMD_TEXTMESSAGE.encode(message,True)) - + debug(f"Engine damage warning sent to {player.username}") - + message_to_client.append(FSNETCMD_AIRCMD.set_afterburner(player.aircraft.id, False, True)) - + return False - + def on_weapon_config(self, data, player, message_to_client, message_to_server): if ENABLED: player.aircraft.just_repaired = True |
