1. Taffy submitted a new resource:

    Welcome Message and Notifications - Show user connections and disconnections and provide a welcome message

    Read more about this resource...
     
  2. Possibly make triggering message "UserMessage" after clicking on the "wake up"?
     
  3. Shall take a look at that :)
     
  4. If I remember correctly pressing the wakeup button ran the console command "wakeup" so you could grab it with the hook OnRunCommand.
     
  5. Thanks mate, was trying to work out where the hell the player state could be hooked from :)
     
  6. Where is the config saved at?
     
  7. oxide\config folder - that's the default location
     
  8. Assuming since your global flag array DisplayedWelcome will remain in memory until server is rebooted the Welcome message will only occur the first time they connect and wake up and not again until the server is restarted. Correct?
     
  9. Nope. If they disconnect I am resetting the flag for the user within the OnPlayerDisconnect function

    if (self.DisplayedWelcome[tmpuser] ~= nil) then
    self.DisplayedWelcome[tmpuser] = nil
    end

    This way if they die during the session they are not going to get the welcome everytime they wake up and if they disconnect, they will get it. No need to restart the server. Thats how its working on my test server anyway :p
     
  10. Is it possible to insert a function to Broadcast a free Text every x minutes ?
     
  11. Can take a look at it mate. Have a few plans for this plugin, fully configurable via config of course.
     
  12. Hi Taffy,

    Where is wakeup established (ply.wakeup) it is not a property on the BasePlayer class, etc?
     
    Last edited by a moderator: Oct 22, 2014
  13. mughisi pointed me at it on post #4 above. When the player presses the wake up button the consolecommand "wakeup" is initiated
     
  14. I think what he means is where you're getting the wakeup from, because it's not part of an object of the type BasePlayer:
    Code:
    public class BasePlayer : BaseEntity
    {
        [CompilerGenerated]
        // Fields
        private static Func<BasePlayer, bool> <>f__am$cache15;
        public static List<BasePlayer> activePlayerList = new List<BasePlayer>();
        public PlayerBelt belt;
        public PlayerBlueprints blueprints;
        public PlayerCollision collision;
        public string displayName;
        public PlayerEyes eyes;
        public PlayerInput input;
        public PlayerInventory inventory;
        public PlayerMetabolism metabolism;
        [NonSerialized]
        private ModelState modelState = new ModelState();
        public BaseMovement movement;
        public PlayerModel playerModel;
        [NonSerialized]
        public PlayerState playerState = new PlayerState();
        private InputState serverInput = new InputState();
        public static List<BasePlayer> sleepingPlayerList = new List<BasePlayer>();
        private int SpectateOffset = 0xf4240;
        [NonSerialized]
        public bool supressSnapshots;
        [NonSerialized]
        public Item svActiveItem;
        internal BoxCollider triggerCollider;
        public ulong userID;
        private Quaternion viewAngles = new Quaternion();    // Methods
        public override void Awake()
        public bool CanFireGun()
        private void ChangePlayerState(PlayerState.Type t, bool immediate = false)
        public void ChatMessage(string msg)
        public void CheckDeathCondition(HitInfo info = null)
        public void Command(string strCommand)
        public void ConsoleMessage(string msg)
        public void Die(HitInfo info = null)
        public void DoAttackShared(HitInfo info)
        private void DoMaterialImpactEffect(HitInfo info)
        public virtual void EndSleeping()
        public static BasePlayer Find(string strNameOrIDOrIP)
        public static BasePlayer FindByID(ulong userID)
        public static BasePlayer FindSleeping(ulong userID)
        public override Quaternion GetNetworkRotation()
        public float GetSpeed(bool bRunning, bool bDucking)
        public override float Health()
        private void InventoryUpdate()
        public bool IsAdmin()
        public bool IsAlive()
        public bool IsConnected()
        public bool IsDead()
        public bool IsOnGround()
        private bool IsPlayerState(PlayerState.Type t)
        public bool IsRunning()
        public bool IsSleeping()
        public bool IsSpectating()
        public void ItemCommand(Message packet)
        public override void Load(BaseNetworkable.LoadInfo info)
        public float MaxDeployDistance(Item item)
        public override float MaxHealth()
        private void MetabolismUpdate()
        public void ModuleMessage(Message packet)
        public void OnAttack(Message packet)
        public override void OnAttacked(HitInfo info)
        public virtual void OnDisconnected()
        internal void OnEnterNetworkGroup(Group group)
        public override void OnInvalidPosition()
        internal void OnLeaveNetworkGroup(Group group)
        private void OnPlayerLanded(float velocity)
        public void OnReceiveTick(Message packet)
        internal void OnReceiveTick_NonLocal(PlayerTick tick)
        public void PlayerInit(Connection c)
        public void Respawn(bool newPos = true)
        public override void Save(BaseNetworkable.SaveInfo info)
        public void SendConsoleCommand(string command)
        public void SendEffect(string effectName)
        public void SendFullSnapshot()
        private void SendModelState()
        public void SendPlayerState()
        private void SendRespawnOptions()
        public override void ServerInit()
        public override void ServerSignal(GameSignal signal, Connection sourceConnection)
        internal bool ShouldFullSave(BaseNetworkable.SaveInfo info)
        public virtual void StartDead()
        public virtual void StartSleeping()
        public void StartSpectating()
        public void StopSpectating()
        private void SV_StartLootingPlayer(uint entityID)
        public void TakeDamage(float amount)
        public void TakeDamage(float amount, DamageType damageType)
        public void TakeDamageIndicator(float fAmount, Vector3 RelativeDirection)
        private void Tick_Spectator()
        public override BasePlayer ToPlayer()
        private void UpdateModelState()
        public void UpdatePlayerCollider(bool bEnabled, bool bDucked)
        public void UpdateRadiation(float fAmount)
        private void UpdateSpectateTarget()
    
     
  15. Ah right. Off the top of my head I cant remember. Will have to dig around again to see if I can work out where I found it last time sorry
     
  16. Spitting out the following error on latest version of oxide & plugin:
    Code:
    [Oxide] 8:18 PM [Error] usernotification: [string "usernotification.lua"]:24: attempt to index local 'connection' (a nil value)
      at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0
      at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0
      at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
      at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
     
  17. Hi,
    What version of RUST you running it on mate? I have just updated my RUST server (v164) with the latest oxide release and not getting the error you reporting
     
  18. Wulf

    Wulf Community Admin

    The OnPlayerSpawn hook was changed a bit, so you may want to take a look at that.
     
  19. Latest version of Rust and Oxide

    Not sure that it'll help since it already tells you the error, but commenting this block:
    Code:
    -- function PLUGIN:OnPlayerSpawn( ply,connection )
    --     if(self.Config.ShowConnected) then
    --         tmpuser= ( connection.username )
    --             --Send message to all connected users
    --                 allusermsg = (self.Config.AllUserMessage)
    --                 allusermsg = allusermsg:gsub("USERNAME",tmpuser)
    --                 global.ConsoleSystem.Broadcast("chat.add \"" .. self.Config.ChatName .. "\" \"" .. allusermsg .. "\"")
    --     end
    -- end
    
    resolves the errors, but it also disables the "USERNAME has connected" message (as I'm sure you're already aware). As far as I can tell though, the rest of the messages work fine (welcome and disconnected).
     
    Last edited by a moderator: Oct 24, 2014