Solved Helicopter notification

Discussion in 'Plugin Requests' started by maksiyshuk, Sep 20, 2015.

  1. How to make a plug-in that gave a chat notification when a helicopter!
     
  2. Code:
    void OnEntitySpawned(BaseEntity entity)
        {
            if(entity != null)
            {
              BaseHelicopter heli = entity.GetComponent<BaseHelicopter>();
           
                if (entity is BaseHelicopter)
                {
                  PrintToChat($"Heli flying in!");
                }  
            }
        }
    
    No plugin needed <.< Just enter this in a smaller, running plugin?!
     
  3. Should work. Save it as "HeliAnnouncer.cs"
     
    Last edited by a moderator: Nov 7, 2015
  4. Thank you - I will test!

    The plugin works, but sometimes when a helicopter is already patrolling the map, there are flood reports that the helicopter appeared!
     
    Last edited by a moderator: Nov 7, 2015
  5. yeah sorry my bad ;x
    Try this

    Moderator edit: Please use the Plugins section for releasing plugins.
     
    Last edited by a moderator: Nov 7, 2015
  6. Thank you - I will test!
     
  7. Hey , where do i put this code on my server? im using cloud forge , do i have to upload it?
     
  8. In case you use Notifier, then Notifier provides this feature :)
     
  9. yea i know , i have notifier , but it doesn't announce airdrops or helicopters for me. So i'm using airdrop controller to announce the airdrops and i will be using this file to announce helicopters.
    [DOUBLEPOST=1444380167][/DOUBLEPOST]Everytime the helicopter fires rockets it spams the message , anyway to fix this?
     
  10. If you update to the latest version of Notifier, and set both Announce Airdrops and Announce Patrol Helicopters settings to true it surely will work.
     
  11. yea i did , and it spammed everytime the heli shot rockets lol
    [DOUBLEPOST=1444569490][/DOUBLEPOST]so i use the announcer from this page
     
  12. By the time I posted my last message here Notifier was already fixed and running well, that is why I suggested you to update, so you havent updated as you should have. :)
     
  13. It's kinda anooying to update then having to do the adverts again
     
  14. Notifier's Update System will not in any case reset the Adverts, even I the developer if I force the config file to be wiped your adverts will always be saved and replaced on the new config file, Notifier will ALWAYS save adverts for you, so this said you don't have to worry about updating Notifier because of the adverts:
    Code:
        def UpdateConfig(self):
            ''' Function to update the configuration file on plugin Init '''        if (self.Config['CONFIG_VERSION'] <= LATEST_CFG - 0.2) or DEV:            adverts = self.Config['ADVERTS']            self.Config.clear()            self.LoadDefaultConfig()            if not DEV: self.Config['ADVERTS'] = adverts            self.con('* Configuration file is two versions old, reseting to default (Advert messages saved!)')        else:            self.Config['CONFIG_VERSION'] = LATEST_CFG            self.con('* Applied new changes to the configuration file')        self.SaveConfig()
    
    P.S: Every time I release an update to one of my plugins the change log of the update always has a colored message indicating any changes to the config file, green messages indicate there were no changes and no resets are required, blue messages indicate what kind of changes the were and still no resets are required and for last the red messages indicate that the update will force the config to be wiped.

    P.S.S: Keep in mind that even if an update forces a configuration wipe, Notifier will always print the following message into your server's console:
     
  15. A great practice that every developer should do ! [thumbs up]
     
  16. So how do i update? i remove the addonn then re-add it?
     
  17. Heli annoucer has stopped working for me after the update :/
     
  18. Wulf

    Wulf Community Admin

    The author would need to update it for the prefab changes, and it should be released under the Plugins section once he does.
     
  19. okay :/
     
  20. Wulf

    Wulf Community Admin