Thread: set int as ammo amount 718

Results 1 to 2 of 2
  1. #1 set int as ammo amount 718 
    Registered Member
    Join Date
    Jun 2015
    Posts
    323
    Thanks given
    21
    Thanks received
    11
    Rep Power
    7
    im trying to make it so the amount of ammo weilded can be saved,

    for example

    in player.java

    public int ammocount = 0;


    in commands.java

    case "getammocount":
    player.ammocount = the amount of ammo that player is wearing
    return true;

    been looking around and rlly cant find out how to do this, theres nothing in my equipment class for this (or that i know of)

    thanks
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2015
    Posts
    44
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Code:
    int ammo = player.getEquipment().getItem(Equipment.SLOT_ARROWS).getAmount();
    Can change slots by changing Equipment.SLOT_ARROWS to what you need.
    Reply With Quote  
     

  3. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 09-07-2013, 05:50 PM
  2. How to set tabs as intefaces?
    By Defiled-X in forum Help
    Replies: 0
    Last Post: 02-04-2013, 02:06 AM
  3. How To Set Javac as an enviroment varriable
    By Gluon in forum Application Development
    Replies: 6
    Last Post: 08-01-2011, 06:33 AM
  4. New Setting Int + Galkon
    By Mrthunder23 in forum Help
    Replies: 0
    Last Post: 10-14-2009, 12:05 AM
  5. How to, set int for all...
    By lukas265 in forum Help
    Replies: 2
    Last Post: 05-06-2009, 07:11 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •