diff options
| author | Ritabrata Das <[email protected]> | 2025-02-15 18:58:01 +0530 |
|---|---|---|
| committer | Ritabrata Das <[email protected]> | 2025-02-15 18:58:01 +0530 |
| commit | 71216e5082346dc6824b50dd103fb264fb205f3d (patch) | |
| tree | fca6e2ae31017ef3ba24804ab280b2ec18051384 /plugins/smoke_on_damage | |
| parent | 1474f8174ca6d0718963ec018f1acef9e43b5be4 (diff) | |
Work on plugin apis, add command support
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 |
