Taffy submitted a new resource:
Welcome Message and Notifications - Show user connections and disconnections and provide a welcome message
Read more about this resource...
Welcome Message and Notifications [Abandoned]
Discussion in 'Plugin Support' started by Taffy, Oct 16, 2014.
-
Possibly make triggering message "UserMessage" after clicking on the "wake up"?
-
-
-
-
Taffy updated Welcome Message and Notifications with a new update entry:
Only displays the welcome message once per session on wake-up click
-
Where is the config saved at?
-
-
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?
-
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 -
Is it possible to insert a function to Broadcast a free Text every x minutes ?
-
Can take a look at it mate. Have a few plans for this plugin, fully configurable via config of course.
-
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 -
-
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()
-
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
-
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
-
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 -
Wulf Community Admin
-
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
Last edited by a moderator: Oct 24, 2014