How to make a plug-in that gave a chat notification when a helicopter!
Solved Helicopter notification
Discussion in 'Plugin Requests' started by maksiyshuk, Sep 20, 2015.
-
Code:
void OnEntitySpawned(BaseEntity entity) { if(entity != null) { BaseHelicopter heli = entity.GetComponent<BaseHelicopter>(); if (entity is BaseHelicopter) { PrintToChat($"Heli flying in!"); } } }
-
Should work. Save it as "HeliAnnouncer.cs"
Last edited by a moderator: Nov 7, 2015 -
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 -
Try this
Moderator edit: Please use the Plugins section for releasing plugins.Last edited by a moderator: Nov 7, 2015 -
Thank you - I will test!
-
Hey , where do i put this code on my server? im using cloud forge , do i have to upload it?
-
In case you use Notifier, then Notifier provides this feature
-
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? -
-
yea i did , and it spammed everytime the heli shot rockets lol
[DOUBLEPOST=1444569490][/DOUBLEPOST]so i use the announcer from this page -
-
It's kinda anooying to update then having to do the adverts again
-
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.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:
-
-
So how do i update? i remove the addonn then re-add it?
-
Heli annoucer has stopped working for me after the update :/
-
Wulf Community Admin
-
okay :/
-
Wulf Community Admin
Since the original posters haven't released a version, HeliInbound for Rust Experimental | Oxide.