Good to see someone working on this again.
Ive done changes myself a while ago for my server, but as the code is written pretty complicated, we did throw it out at some day.
ill keep an eye on this thread and help when i canLoved this plugin back then.
Btw,- as you changed the commands, remember to change the ingame plugin-chat messages aswell as it still said "use /hgui"![]()
HuntRPG
Moved
Total Downloads: 16,958 - First Release: Mar 15, 2015 - Last Update: Jul 30, 2018
- 5/5, 73 likes
-
Apologies for not applying it haha. -
-
That was a good idea to see if the message reciever isn't an NPC, but... what if it's an npc created by Human NPC - Core
Here is the function that I'm using (if you need it ofc =P):
Code:private bool IsNPC(BasePlayer player) { //BotSpawn if (player is NPCPlayer) return true; //HumanNPC if (!(player.userID >= 76560000000000000L || player.userID <= 0L)) return true; return false; }
-
I’ll attempt your fix at it, but I can’t be sure it will work with BotSpawn, unless you’ve already tried it haha
[DOUBLEPOST=1519744301][/DOUBLEPOST]
Should be good then, let me go ahead and update it quickly. -
-
This is not a hook =)
This is a small function that just checks the BasePlayer for being both - in-game NPC and handmade by the HumanNPC plugin =) -
Should all be good then. -
Dude. You've done literraly nothing in this update =D
You just added this function to the code and never called it =))
So - if you want to use it - call it on line 155, in the OnEntityTakeDamage insted of just if (player is NPCPlayer)
If you would take a closer look to my func - you would see that this check is already done in there.... -
Gimme a minute.
[DOUBLEPOST=1519745576][/DOUBLEPOST]Code:void OnEntityTakeDamage(BasePlayer player, HitInfo hitInfo) { if (player is NPCPlayer) return; if (!(player.userID >= 76560000000000000L || player.userID <= 0L)) return; var rpgInfo = FindRpgInfo(player); if (rpgInfo == null) return; var victim = hitInfo.Initiator; if (victim is BasePlayer) { if (Random.Range(0f, 1f) <= rpgInfo.GetEvasion()) { ChatMessage(player, HMK.Dodged); if (!(victim is NPCPlayer)) { ChatMessage(victim, HMK.TargetDodged); } hitInfo.damageTypes.ScaleAll(0); } } if (rpgInfo.GetBlock() <= 1 && rpgInfo.GetBlock() >= 0) { hitInfo.damageTypes.ScaleAll(1 - rpgInfo.GetBlock()); } }
-
Dude, why did you copy the code of the function to the OnEntity..., you could've just call it.... nvrmind, this is your code, I just gave you a suggestion -
Weird, it works though.
Thanks for the help. -
-
getting this -
Code:Exception while calling NextTick callback (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.HuntRPG+<OnStructureUpgrade>c__AnonStorey1.<>m__0 () [0x00000] in <filename unknown>:0 at Oxide.Core.OxideMod.OnFrame (Single delta) [0x00000] in <filename unknown>:0 (11:54:06) | Exception while calling NextTick callback (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.HuntRPG+<OnStructureUpgrade>c__AnonStorey1.<>m__0 () [0x00000] in <filename unknown>:0 at Oxide.Core.OxideMod.OnFrame (Single delta) [0x00000] in <filename unknown>:0
Last edited by a moderator: Mar 5, 2018 -
-
-
-
-
I’ll see what I can do, otherwise it might be an incompatible plugin.
I’ll probably add a plugin check. -
If you're talking about this
Code:Exception while calling NextTick callback