I've suddenly started getting this issue when using /pc
Any ideas how to fix it?Code:Failed to call hook 'cmdPC' on plugin 'PlayerChallenges v2.0.10' (ArgumentException: An element with the same key already exists in the dictionary.) at System.Collections.Generic.Dictionary`2[System.String,System.Int32].Add (System.String key, Int32 value) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.GetLeaders (Challenges type) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.AddMenuStats (Oxide.Game.Rust.Cui.CuiElementContainer& MenuElement, System.String panel, Challenges type, Single left, Single bottom, Single right, Single top) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.CreateMenuContents (.BasePlayer player, Int32 page) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.CreateMenu (.BasePlayer player) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.cmdPC (.BasePlayer player, System.String command, System.String[] args) [0x00000] in :0 at Oxide.Plugins.PlayerChallenges.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0
Edit: Fixed it by updating to latest version, didn't realise it was outdated.

Player Challenges
Allows titles to be set when certain criteria are met, with a UI Leader board
Total Downloads: 5,643 - First Release: Nov 11, 2015 - Last Update: May 5, 2018
- 5/5, 20 likes
-
/pc commands only WORK for me (ADMIN) why??? How can I put to all players!!!??
-
-
Yes default config!!!!
-
-
No one can use, only me "admin"..... can u help me?
-
-
@~SGC~Clipper01745 make sure to download the latest version of this plugin, thats how I fixed mine.
-
-Fishloki91 (server owner) -
I'm having the same problem as of last Thursdays update. Anytime ANYONE types /pc in chat it pulls up a blank list and cannot close out. Have to DC and RC to clear. I'm on the latest version.
-
*suggestion. Making a fail-safe so players can't farm kills (like their alt accounts/friends) would be nice.
Like
Max # of same player kills before they don't count: 5
Within (minutes): 60 -
-
-
Sneaky, sneaky... I know @nivex came up with a really good checker to combat this in his duellist plugin. Perhaps a similar check could be used with this... Them stat padders need a swift slap!
-
Code:
private readonly int constructionMask = LayerMask.GetMask("Construction", "Deployed"); public bool IsAllied(BasePlayer player, BasePlayer target) { if (player.IsAdmin && target.IsAdmin) return false; return IsInSameClan(player, target) || IsAuthorizing(player, target) || IsBunked(player, target) || IsCodeAuthed(player, target) || IsInSameBase(player, target); } private bool IsInSameClan(BasePlayer player, BasePlayer target) // 1st method { if (player.displayName.StartsWith("[") && player.displayName.Contains("]")) { if (target.displayName.StartsWith("[") && target.displayName.Contains("]")) { string playerClan = player.displayName.Substring(0, player.displayName.IndexOf("]")); string targetClan = target.displayName.Substring(0, target.displayName.IndexOf("]")); return playerClan == targetClan; } } return false; } private bool IsAuthorizing(BasePlayer player, BasePlayer target) // 2nd method. thanks @psychotea for the linq suggestion { return player.buildingPrivilege.Any(x => x.IsAuthed(target)) || target.buildingPrivilege.Any(x => x.IsAuthed(player)); } private bool IsBunked(BasePlayer player, BasePlayer target) // 3rd method. thanks @i_love_code for helping with this too { var targetBags = SleepingBag.FindForPlayer(target.userID, true); if (targetBags.Count() > 0) foreach (var pbag in SleepingBag.FindForPlayer(player.userID, true)) if (targetBags.Any(tbag => Vector3.Distance(pbag.transform.position, tbag.transform.position) < 25f)) return true; return false; } private bool IsCodeAuthed(BasePlayer player, BasePlayer target) // 4th method. nice and clean linq { foreach (var codelock in BaseNetworkable.serverEntities.Where(e => e != null && e is CodeLock).Cast<CodeLock>()) { if (codelock.whitelistPlayers.Any(id => id == player.userID)) { if (codelock.whitelistPlayers.Any(id => id == target.userID)) { return true; } } } return false; } private bool IsInSameBase(BasePlayer player, BasePlayer target) // 5th method { bool _sharesBase = false; // to free the pooled lists foreach (var priv in player.buildingPrivilege) { var colliders = Pool.GetList<Collider>(); Vis.Colliders(priv.transform.position, 25f, colliders, constructionMask, QueryTriggerInteraction.Collide); foreach (var collider in colliders) { var entity = collider.GetComponent<BaseEntity>(); if (!entity) continue; if (entity.OwnerID == target.userID) { _sharesBase = true; break; } } Pool.FreeList(ref colliders); // free it. if (_sharesBase) return true; } foreach (var priv in target.buildingPrivilege) { var colliders = Pool.GetList<Collider>(); Vis.Colliders(priv.transform.position, 25f, colliders, constructionMask, QueryTriggerInteraction.Collide); foreach (var collider in colliders) { var entity = collider.GetComponent<BaseEntity>(); if (!entity) continue; if (entity.OwnerID == player.userID) { _sharesBase = true; break; } } Pool.FreeList(ref colliders); } return _sharesBase; }
-
There you go see
TY @nivex
-
installed like i would every other plugin, /pc "unknown command
c" any reason this might be?
here is my .json
{
"ChallengeSettings": {
"AnimalKills": {
"Enabled": true,
"Priority": 5,
"Title": "Hunter",
"UIPosition": 0
},
"ArrowKills": {
"Enabled": true,
"Priority": 11,
"Title": "Archer",
"UIPosition": 1
},
"BladeKills": {
"Enabled": true,
"Priority": 9,
"Title": "BladeKillsman",
"UIPosition": 16
},
"ClothesCrafted": {
"Enabled": true,
"Priority": 19,
"Title": "Tailor",
"UIPosition": 3
},
"ExplosivesThrown": {
"Enabled": true,
"Priority": 10,
"Title": "Bomb-tech",
"UIPosition": 4
},
"Headshots": {
"Enabled": true,
"Priority": 1,
"Title": "Assassin",
"UIPosition": 5
},
"MeleeKills": {
"Enabled": true,
"Priority": 3,
"Title": "Fighter",
"UIPosition": 8
},
"PlantsGathered": {
"Enabled": true,
"Priority": 17,
"Title": "Harvester",
"UIPosition": 9
},
"PlayersHealed": {
"Enabled": true,
"Priority": 18,
"Title": "Medic",
"UIPosition": 6
},
"PlayersKilled": {
"Enabled": true,
"Priority": 2,
"Title": "Murderer",
"UIPosition": 7
},
"PVEKillDistance": {
"Enabled": true,
"Priority": 6,
"Title": "Deadshot",
"UIPosition": 10
},
"PVPKillDistance": {
"Enabled": true,
"Priority": 4,
"Title": "Sniper",
"UIPosition": 11
},
"QuestsCompleted": {
"Enabled": false,
"Priority": 20,
"Title": "Adventurer",
"UIPosition": 19
},
"RevolverKills": {
"Enabled": true,
"Priority": 7,
"Title": "Gunslinger",
"UIPosition": 13
},
"RocketsFired": {
"Enabled": true,
"Priority": 8,
"Title": "Rocketeer",
"UIPosition": 14
},
"RocksGathered": {
"Enabled": true,
"Priority": 16,
"Title": "Miner",
"UIPosition": 15
},
"StructuresBuilt": {
"Enabled": true,
"Priority": 12,
"Title": "Architect",
"UIPosition": 2
},
"StructuresRepaired": {
"Enabled": true,
"Priority": 13,
"Title": "Handyman",
"UIPosition": 12
},
"WeaponsCrafted": {
"Enabled": true,
"Priority": 14,
"Title": "Gunsmith",
"UIPosition": 17
},
"WoodGathered": {
"Enabled": true,
"Priority": 15,
"Title": "Lumberjack",
"UIPosition": 18
}
},
"Colors": {
"MSG_ColorMain": "orange",
"MSG_ColorMsg": "#939393",
"TitleColor": "#88E188"
},
"Options": {
"AnnounceNewLeaders": true,
"IgnoreAdmins": true,
"IgnoreEventKills": true,
"IgnoreSleepers": false,
"IgnoreSupplySignals": true,
"IgnoreSurveyCharges": true,
"MaximumTags": 3,
"SaveTimer": 600,
"TagFormat": "[{TAG}]",
"UpdateTimer": 168,
"UseBetterChat": true,
"UseOxideGroups": false,
"UseUpdateTimer": false
}
} -
even downloading the plugin and deleting the old file doesn't work, help please!
-
- make sure to remove plugin file-config and data then re download pc to make sure u have the corect vertion and put it back in the plugin section!
- download my .json put it in config section.
- then /reload PlayerChallenges.
- also if u have better chat make sure to enable player tagging
- tip also u can drag your .json file in your message insted ov putting the hole code in!
Attached Files:
-
Have this Error:
(09:20:17) | Failed to call hook 'OnEntityDeath' on plugin 'PlayerChallenges v2.0.2' (NullReferenceException: Object reference not set to an instance of an object)Last edited by a moderator: Sep 22, 2017