Thread: Arraylists and playerName [PI] Rep++

Results 1 to 3 of 3
  1. #1 Arraylists and playerName [PI] Rep++ 
    Registered Member
    Join Date
    Feb 2011
    Age
    30
    Posts
    87
    Thanks given
    2
    Thanks received
    17
    Rep Power
    3
    right, so im working on a lottery system and its driving me nuts lol

    ive got the majority done but i cant get it to draw the winner correctly im using arraylists that store the players name ive managed to get that far and i can get it to select and identify a winner from the arraylist but i need to figure out a way to get it to identify that player and define them as c so i can add the reward and such, cant seem to get my head around it lol

    will be releasing the system when i figure it out

    any help would be appreciated guys,

    thanks
    ___________________________________
    Rune-X-Scape (Top 10) - SUMMONING!
    __________________________________

    Rune-X-Scape V1 release - here

    check my Services Thread
    __________________________________
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Code:
    Client client = null;
    for(int i = 0; i < PlayerHandler.players.lenth; i++) {
         if(PlayerHandler.players[i] != null) {
             if(PlayerHandler.players[i].playerName.equalsIgnoreCase(winner)) {
                 client = (Client)PlayerHandler.players[i];
                 break;
             }
    
         }
    }
    if(client != null) {
        client.addItem(995, 1);
        client.sendMessage("Congratulations you won the lottery!");
    }
    Typed in thread, will need changing to your own methods.
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Feb 2011
    Age
    30
    Posts
    87
    Thanks given
    2
    Thanks received
    17
    Rep Power
    3
    thanks, back to getting my head round it properly lol, repped

    Link to lottery system release
    ___________________________________
    Rune-X-Scape (Top 10) - SUMMONING!
    __________________________________

    Rune-X-Scape V1 release - here

    check my Services Thread
    __________________________________
    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. playerName
    By Mrthunder23 in forum Help
    Replies: 12
    Last Post: 06-26-2010, 06:31 AM
  2. playername
    By Warlock 999 in forum Help
    Replies: 6
    Last Post: 10-20-2009, 01:38 AM
  3. ArrayLists Vs Vectors
    By Mrquarterx in forum RS2 Server
    Replies: 14
    Last Post: 07-10-2009, 09:10 PM
  4. File writing and reading for ArrayLists
    By bloodargon in forum Snippets
    Replies: 8
    Last Post: 07-01-2009, 03:27 AM
  5. getting some 1s playername
    By Robin Spud in forum Help
    Replies: 2
    Last Post: 06-14-2009, 10:24 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
  •