ask those questions on the general legacy forum not here as it has nothing to do with the plugin.
Casper [Unmaintained]
Discussion in 'Plugin Support' started by Reneb, Apr 20, 2015.
-
keeps saying i dont have permission
[DOUBLEPOST=1432108504][/DOUBLEPOST]ow i thought u could give perm with an inbuild command lol -
Hi
I'm trying to modify the casper plugin, by adding this message (/casper => activate deactivate the casper mod) to the (/help command) so It can show up for my MODS/ADMINS.
This is the code I added to the bottom of the C.Sharp Plugin called (Casper)
Code:{ caspers.Add(humancontroller); SendReply(netuser, "Casper: ON, when you get back to the ground, no one will see you nor hear you!"); netuser.playerClient.rootControllable.GetComponent<TakeDamage>().SetGodMode(true); timer.Once(1f, () => ClearAllInjuries(netuser)); } } void SendHelpText(NetUser netuser) { if (hasAccess(netuser, "cancasper")) SendReply(netuser, "Casper CanCasper:/casper => activate deactivate the casper mod"); } } }
Code:[Oxide] 11:34PM [Error] Casper plugin failed to compile! [Oxide] 11:34PM [Error] Casper.cs<86,17: error CS1501: No overload for method 'hasAccess' takes '2' arguments
-
-
Wulf Community Admin
-
Code:5:09 PM [Info] Unloaded plugin Auto Admin v1.0.0 by greyhawk, Ported by Reneb to Oxide 2.0 5:09 PM [Info] Unloaded plugin Helptext v1.0.1 by #Domestos 5:09 PM [Info] Unloaded plugin RustDB v1.0.0 by Reneb 5:09 PM [Info] Unloaded plugin Server Information Announcer v1.0.0 by Mughisi 5:09 PM [Info] Unloaded plugin AntiCheat v2.0.13 by Reneb 5:09 PM [Info] Unloaded plugin AntiGlitch v2.0.4 by Reneb 5:09 PM [Info] Unloaded plugin Casper v1.0.0 by Reneb 5:09 PM [Info] Unloaded plugin Kits v1.0.8 by Reneb 5:09 PM [Info] Unloaded plugin LootSpawnLists v2.0.2 by Reneb from thomasfn 5:09 PM [Info] Unloaded plugin Player List v0.1.0 by Hatemail 5:09 PM [Info] Unloaded plugin Prod v1.0.2 by Reneb 5:09 PM [Info] Unloaded plugin ResourceManager v1.0.2 by Reneb 5:09 PM [Info] Unloaded plugin SetHome v1.0.0 by Reneb 5:09 PM [Info] Unloaded plugin TPR v1.0.2 by Reneb 5:09 PM [Info] Unloaded plugin VACKicker v1.0.0 by Reneb 5:10 PM [Info] Loading Oxide core v2.0.974... 5:10 PM [Info] Loading extensions... 5:10 PM [Info] Loaded extension CSharp v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension JavaScript v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension Lua v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension MySql v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension Python v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension SQLite v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension Unity v1.0.974 by Oxide Team 5:10 PM [Info] Loaded extension RustLegacy v1.0.974 by Oxide Team 5:10 PM [Info] Loading plugins... 5:10 PM [Info] Loaded plugin Unity Core v1.0.0 by Oxide Team 5:10 PM [Info] Loaded plugin Rust Legacy Core v1.0.0 by Oxide Team 5:10 PM [Info] Loaded plugin Helptext v1.0.1 by #Domestos 5:10 PM [Info] Loaded plugin RustDB v1.0.0 by Reneb 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'AntiCheat' 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'AntiGlitch' 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'Kits' 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'LootSpawnLists' 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'Prod' 5:10 PM [Warning] Ignored obsolete game extension reference 'Oxide.Ext.RustLegacy' in plugin 'RemoverTool' 5:10 PM [Info] Announcer, AntiCheat, AntiGlitch, Casper, Kits, LootSpawnLists, PlayerList, Prod, ResourceManager, SetHome, TPR and VACKicker were compiled successfully in 4635ms 5:10 PM [Error] Error while compiling DoorShare.cs(7,13): error CS0234: The type or namespace name `RustLegacy' does not exist in the namespace `Oxide'. Are you missing an assembly reference? 5:10 PM [Error] Error while compiling RemoverTool.cs(13,13): error CS0234: The type or namespace name `RustLegacy' does not exist in the namespace `Oxide'. Are you missing an assembly reference? 5:10 PM [Info] Loaded plugin Server Information Announcer v1.0.0 by Mughisi 5:10 PM [Info] Loaded plugin AntiCheat v2.0.13 by Reneb 5:10 PM [Info] Loaded plugin AntiGlitch v2.0.4 by Reneb 5:10 PM [Info] Loaded plugin Casper v1.0.0 by Reneb 5:10 PM [Info] Loaded plugin Kits v1.0.8 by Reneb 5:10 PM [Info] Loaded plugin LootSpawnLists v2.0.2 by Reneb from thomasfn 5:10 PM [Info] Loaded plugin Player List v0.1.0 by Hatemail 5:10 PM [Info] Loaded plugin Prod v1.0.2 by Reneb 5:10 PM [Info] Loaded plugin ResourceManager v1.0.2 by Reneb 5:10 PM [Info] Loaded plugin SetHome v1.0.0 by Reneb 5:10 PM [Info] Loaded plugin TPR v1.0.2 by Reneb 5:10 PM [Info] Loaded plugin VACKicker v1.0.0 by Reneb 5:10 PM [Warning] Time travelling detected! Timers were updated 8.75 seconds in the future? We will attempt to recover but this should really never happen! 5:10 PM [Info] [Server Information Announcer] Server Information Announcer : V3ND3774 has joined the server! 5:10 PM [Info] 0 5:10 PM [Error] Failed to call hook 'OnPlayerSpawn' on plugin 'AntiCheat' (NullReferenceException: Object reference not set to an instance of an object) 5:10 PM [Debug] at Oxide.Plugins.AntiCheat.GetPlayerData (.PlayerClient player) [0x00000] in <filename unknown>:0 at Oxide.Plugins.AntiCheat.OnPlayerSpawn (.PlayerClient player, Boolean useCamp, RustProto.Avatar avatar) [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 5:10 PM [Info] [LootSpawnLists] 31 custom loot tables were loaded! 5:10 PM [Info] [ResourceManager] 46 custom resource spawns where loaded! 5:10 PM [Warning] CallHook 'OnServerInitialized' on plugin 'ResourceManager' took: 4538ms
Last edited by a moderator: May 23, 2015 -
Wulf Community Admin
-
In regards to Casper not working, is it possible that A3mon may be the cause? I have it installed while I am testing the anticheat addons. -
Wulf Community Admin
http://oxidemod.org/threads/r-remover.2779/page-33#post-90282
I don't know what the Casper issue is, so you'll likely have to wait to see what Reneb has to say about it. -
-
Wulf Community Admin
-
Still not working right.
Oh well I can wait on Reneb to look into it. Not a critical addon, but absolutely a great tool for server admins. -
when i load this it asks if im missing an assembly reference...error CS0246
-
Try this one:
Code:using System.Collections.Generic; using System; using System.Reflection; using UnityEngine; using Oxide.Core.Plugins; using RustProto;namespace Oxide.Plugins { [Info("Casper", "Reneb", "1.0.0")] class Casper : RustLegacyPlugin { RustServerManagement manager; Vector3 VectorAway = new Vector3(0f, 500f, 0f); void Loaded() { manager = RustServerManagement.Get(); if (!permission.PermissionExists("cancasper")) permission.RegisterPermission("cancasper", this); } List<HumanController> caspers = new List<HumanController>(); Dictionary<HumanController,Vector3> teleported = new Dictionary<HumanController, Vector3>(); object OnGetClientMove(HumanController human, Vector3 origin, int encoded, ushort stateFlags, uLink.NetworkMessageInfo info) { if(!caspers.Contains(human)) return null; if (teleported.ContainsKey(human)) return false; if (human.dead) return null; if (human.networkView.viewID == uLink.NetworkViewID.unassigned) return null; Angle2 ang = new Angle2 { encoded = encoded }; teleported.Add(human, origin); human.idMain.origin = origin + VectorAway; human.idMain.eyesAngles = ang; human.idMain.stateFlags.flags = stateFlags; object[] args = new object[] { origin + VectorAway, ang.encoded, stateFlags, (float)(NetCull.time - info.timestamp) }; human.networkView.RPC("ReadClientMove", uLink.RPCMode.Others, args); human.ServerFrame(); return false; } void ClearAllInjuries(NetUser netuser) { if (netuser == null || netuser.playerClient == null) return; if (netuser.playerClient.rootControllable == null) return; if (!caspers.Contains(netuser.playerClient.rootControllable.GetComponent<HumanController>())) return; netuser.playerClient.rootControllable.GetComponent<FallDamage>().ClearInjury(); timer.Once(1f, () => ClearAllInjuries(netuser)); } bool hasAccess(NetUser netuser) { if (netuser.CanAdmin()) return true; return permission.UserHasPermission(netuser.playerClient.userID.ToString(), "cancasper"); } [ChatCommand("casper")] void cmdChatCasper(NetUser netuser, string command, string[] args) { if (!hasAccess(netuser)) { SendReply(netuser, "You dont have access to this command."); return; } var humancontroller = netuser.playerClient.rootControllable.GetComponent<HumanController>(); if(caspers.Contains(humancontroller)) { SendReply(netuser, "Casper: OFF"); caspers.Remove(humancontroller); if (teleported.ContainsKey(humancontroller)) { manager.TeleportPlayerToWorld(netuser.networkPlayer, teleported[humancontroller]); teleported.Remove(humancontroller); } netuser.playerClient.rootControllable.GetComponent<TakeDamage>().SetGodMode(false); return; } else { caspers.Add(humancontroller); SendReply(netuser, "Casper: ON, when you get back to the ground, no one will see you nor hear you!"); netuser.playerClient.rootControllable.GetComponent<TakeDamage>().SetGodMode(true); timer.Once(1f, () => ClearAllInjuries(netuser)); return; } } } }
-
Wulf Community Admin
-
Here you go .cs file. I just changed few "using" parts. Like other plugins needed to.
Attached Files:
-
-
Will this work for admin only? or how do I go about that
-
This isn't working for Oxide 2.0... I've tried following the error logs and nothing. The plugin loads fine but doesn't work.
-
-
It now works, however, people and buildings suddenly disappear. My short term fix is turning casper off and turning it back on. I need a better option.Last edited by a moderator: Jul 12, 2015