Level System

A simple plugin to add XP and levels in the game

Total Downloads: 1,276 - First Release: Apr 9, 2016 - Last Update: Apr 1, 2018

5/5, 11 likes
  1. D-Kay submitted a new resource:

    Level System - A simple plugin to add XP and levels in the game

    Read more about this resource...
     
  2. Wulf

    Wulf Community Admin

    If you'd like to take over the Kits plugin, it'd probably be fine. Also, I would recommend having the filename as LevelSystem, not Level, and the permissions matching that. :)
     
  3. its bossible to set pvexp on and also gold loot sametime?
    [DOUBLEPOST=1460180855][/DOUBLEPOST]or its bossible to give players to commands xppve
    [DOUBLEPOST=1460187648,1460180066][/DOUBLEPOST]its bossible to set pvexp on and also gold loot sametime? gold loot work when i remove rank plugins:) good work and very nice plugins
    [DOUBLEPOST=1460188952][/DOUBLEPOST]For those who want I have edited the existing Kits for Reign of Kings by Mughisi to have the level as a parameter. Pm me about it if you want it.
    what that mean?lvl and kit work together?lvl giving also revard?if its ofg i want that:) great works these plugins
     
  4. so how do i turn xp on
     
  5. Type /xppve or /xppvp to toggle the type you want.

    All of the current chat commands are:
    Code:
    /xp  - checks current xp
    /givexp  - gives a certain amount of xp
    /removexp  - removes a certain amount of xp
    /clearxp  - completely wipes all xp data
    /levellist  - shows a list of all player levels
    /topplayers  - shows a top 10(default) list
    /xppvp  - toggle pvp xp on/off
    /xppve  - toggle pve xp on/off
    There appears to be a help text but I don't see a command for it currently. That is either a work in progress or I just don't know how to use it haha.

    EDIT:
    I forgot to give thanks to D-Kay for this awesome plugin. This can open up a lot of possibilities in the future. Hope to see future updates :)
     
    Last edited by a moderator: Apr 9, 2016
  6. Hello i have error , level don´t work :-(
     
  7. What it this?
     

    Attached Files:

  8. i have self problem , this Author is don´t active please help help help
     
  9. Try typing "/ xppvp" and "/xppve". I believe they are both turned off by default.
     
  10. D-Kay updated Level System with a new update entry:

    0.4

     
  11. This means I edited the existing kits plugin so you can set the level of a player as a requirement for the kit.
    Example: There is a kit with requirement level 10. A player with level 9 won't be able to redeem it.

    Can you tell me what error you get? I also have a couple of errors but I get the same errors from multiple plugins though they still work.

    Could you try removing all the files from this plugin and then only adding the plugin file in the plugin folder? Let me know if it helped.

    All toggles are turned on by default.
     
  12. D-Kay updated Level System with a new update entry:

    0.4.1

     
  13. Hi, just a little question : is it normal to get the error "[Oxide] 16:54 [Error] Failed to call hook 'OnEntityHealthChange' on plugin 'Level v0.4.1' (NullReferenceException: Object reference not set to an instance of an object)" each time that a player hit an animal?

    Edit : Error appears when a player gains health points.

    Edit 2 : Do you think that the following code would change anything?
    Code:
    private void OnEntityHealthChange(EntityDamageEvent damageEvent)
            {
                if (damageEvent.Damage.Amount > 0)
                {
                    return;
                }
                if (useDamageBonus)
                {
                    if (damageEvent.Damage.DamageSource.IsPlayer && damageEvent.Entity.Owner != damageEvent.Damage.DamageSource.Owner)
                    {
                        Player player = damageEvent.Damage.DamageSource.Owner;
                        int PlayerCurrentLevel = GetCurrentLevel(player);
                        double damage = damageEvent.Damage.Amount;
                        double damageBonus = 0;                    if (damageEvent.Entity.IsPlayer) damageBonus = playerDamageBonusPercentage;
                        else if (damageEvent.Entity.Owner.DisplayName == "server") damageBonus = monsterDamageBonusPercentage;
                      
                        damageEvent.Damage.Amount = GiveBonus(PlayerCurrentLevel, damage, damageBonus, 1);
                    }
                }
                if (useDefenseBonus)
                {
                    if (damageEvent.Entity.IsPlayer)
                    {
                        Player victim = damageEvent.Entity.Owner;
                        int VictimCurrentLevel = GetCurrentLevel(victim);
                        double damage = damageEvent.Damage.Amount;
                        double defenseBonus = 0;
                      
                        Health h = damageEvent.Damage.DamageSource.TryGet<Health>();
                        bool villager = h.ToString().Contains("Plague Villager");
                        bool bear = h.ToString().Contains("Grizzly Bear");
                        bool wolf = h.ToString().Contains("Wolf");
                        bool werewolf = h.ToString().Contains("Werewolf");
                      
                        if (damageEvent.Damage.DamageSource.IsPlayer) defenseBonus = playerDefenseBonus;
                        else if (villager || bear || wolf || werewolf) defenseBonus = monsterDefenseBonus;
                      
                        damageEvent.Damage.Amount = GiveBonus(VictimCurrentLevel, damage, defenseBonus, 2);
                    }
                }
            }
     
    Last edited by a moderator: Jun 10, 2016
  14. With that code, the function would end immediately. If I hit someone with any weapon the hook will be called but since the damage is greater then zero it would end, giving none of the bonuses.
     
  15. Sorry, fail, it's "<" not ">"
     
  16. No because the error is because of a NULL reference, which means there is nothing. If the damage was negative there still is something. I'm gonna test a few thinks and see if it works out.
     
  17. And I got the same with the thirst damages, if it can help
     
  18. I get the error from multiple plugins both mine as others though it doesn't seem to affect the working of the plugins.
     
  19. The plugin isn't affected, but I'm trying to get clean logs, is there a way not to get this error?