null > 0

Discussion in 'Plugin Development' started by Henriksen1000, Oct 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Henriksen1000

    Hello!

    I have coded a warn plugin.
    When you warn a player, the target will get a warn message and a Warn level saved in a config.

    I have coded a command /getinfo <name> and it shows the warn level, when a player have been warned X times, the X warn amount will be shown in the message, but when the player don't have been warned, and I use the command /getinfo to check the player, it only shows null.

    So, my question is, how do I replace null with 0?

    Thanks for reading!
    If you need the code, ask.
     
  2. Offline

    WinX64

    That depends, what are you using to store the player's warnings? Could you show us the entire code of your command?
     
  3. Offline

    tkuiyeager1

    you need to check if the config file contains the other player that you want to get the warn information about, if the config file doesnt contain the other player then send the player a message that says: Warn Level: 0, or something like that and then return false
     
  4. Offline

    Henriksen1000

    Oh ok! Thanks
     
  5. Offline

    tkuiyeager1

    @Henriksen1000 please mark your thread as solved if your problem solved.
     
  6. Offline

    Tecno_Wizard

    @Henriksen1000, if your using a config, set the second arg for the default. Should prevent you from getting nulls.
     
  7. Offline

    Henriksen1000

    You don't need to say it... I know that I need to mark it Solved if it is solved.

    If it isn't solved, I won't set it solved.
    As long as the null stay in the message, this isn't solved.
     
  8. Offline

    tkuiyeager1

    @Henriksen1000 oh sorry i thought your issue has been solved because you said:

     
  9. Offline

    Scimiguy

Thread Status:
Not open for further replies.

Share This Page