Thread: [508] Help with a class

Results 1 to 4 of 4
  1. #1 [508] Help with a class 
    Registered Member
    Join Date
    Jan 2010
    Posts
    590
    Thanks given
    15
    Thanks received
    6
    Rep Power
    3
    Well, I've made a gambling class, but I cannot get it to work right.
    Here is the void in the class:
    Code:
    public void options(int amount, int money) {
             if (!Engine.playerItems.addItem(player, 955, money)) {
             player.getActionSender().sendMessage(player, "You need at least " + money  + "m cash to use this feature.");
             return;
             }
             playGame();
             }
    Here is the case at ObjectOption1:
    Code:
    case 1590:
    Gambling.options(1000000, 1);
    break;
    The error:
    Code:
    non-static method options(int, int) cannot be referenced from a static context Gambling.options(1000000, 1);

    Thanks for the helpers will rep.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2010
    Posts
    590
    Thanks given
    15
    Thanks received
    6
    Rep Power
    3
    Bump?
    Reply With Quote  
     

  3. #3  
    Registered Member
    AndyJay's Avatar
    Join Date
    Jun 2008
    Posts
    1,285
    Thanks given
    38
    Thanks received
    48
    Rep Power
    84
    Idk if you fixed this but just add public Gambling Gambling; into objectOption1. Make sure you have the Gambling class imported.


    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Oct 2008
    Posts
    314
    Thanks given
    0
    Thanks received
    39
    Rep Power
    33
    public Gambling g = new Gambling()

    g.options(1000000, 1);
    Reply With Quote  
     


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: 19
    Last Post: 05-25-2010, 02:22 PM
  2. Class20, Class 8, Class 5
    By Exion in forum Help
    Replies: 1
    Last Post: 05-23-2010, 07:20 PM
  3. Which class is the object class?
    By Mr. Epic in forum Help
    Replies: 2
    Last Post: 12-22-2009, 12:58 AM
  4. Which class for npc?
    By Rugrats in forum Help
    Replies: 3
    Last Post: 09-12-2009, 04:27 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •