[SOLVED] Initially Set a Hash Map's Integer

Discussion in 'Plugin Development' started by KaiBB, Dec 27, 2011.

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

    KaiBB

    I want to initially set the integer in the HashMap to 3. But I'm not sure how, as I don't know how to initially get the player (That would be without an event) to set his integer to 3. Can someone help?
    @SwearWord
    @Jaker232
     
  2. Offline

    Jaker232

    You would use the put function to set it. Then you want when the warning is issued to check it.
     
  3. Offline

    SwearWord

    @KaiBB
    Like I said, please come onto IRC and we can help you better. Also, your question is confusing and in general you count up not down.
     
  4. Offline

    KaiBB

    No I'm not really using warnings. I want, before EVERYTHING else, to set the integer for the player to 3.
     
  5. Offline

    SwearWord

    @KaiBB
    You need to use an onPlayerJoin event and use my EXACT code from the other thread except change it to 3 instead of 1, again you should really count upwards.
     
  6. Offline

    KaiBB

    Oh my god. I need to count up. Thanks, I needed to think outside of the box more often. It's really lives, not warnings, so I wanted to count down, but it's way easier to count up. THANK YOU. I'm forever in your debt :D
     
  7. Offline

    Jaker232

    Ooh, so you mean players start with 3, so they get a warning, it drops to 2, and so forth. I guess you could set the map to have a value of 3 for the key 'player' in string form. Give me some code in PM and I can see what I can do, as well describe what you want to happen to trigger it, like player login, and stuff.
     
  8. Offline

    AlbireoX

    I wouldn't do anything on onplayerjoin. Just make a "decrement" and "increment" and if the value is not set/not found in your database, do 3 + or - 1 depending on what you're doing.
     
  9. Offline

    KaiBB

    This is solved. Please do not reply. Thank you.
     
  10. Offline

    SwearWord

    @AlbireoX
    If you look on the other thread that's what I did.
     
Thread Status:
Not open for further replies.

Share This Page