Thread: need help with gambling...

Results 1 to 5 of 5
  1. #1 need help with gambling... 
    Registered Member
    Join Date
    Mar 2008
    Posts
    10
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    well i used a tutorial i found on here and i made gambling into a command, with a few changes for the better, i have this so far,
    Code:
    if (command.startsWith("gamble")) {
    deleteItem(995, getItemSlot(995), 500000);
    if(misc.random(2) == (1)){
    sendMessage("You win 500k!");
    addItem(995, 1000000);
    }
    else sendMessage("Sorry, you lost your money!");
    }
    i need help so if you dont have the initial 500k, the command wont work, anyone help please?
    Reply With Quote  
     

  2. #2  
    jer123
    Guest
    nvm sorry man
    Reply With Quote  
     

  3. #3  
    Registered Member stuart12's Avatar
    Join Date
    Sep 2008
    Age
    30
    Posts
    78
    Thanks given
    0
    Thanks received
    1
    Rep Power
    5
    Code:
    if (command.startsWith("gamble")) {
    if(playerHasItemAmount(995, 500000)) {
    deleteItem(995, getItemSlot(995), 500000);
    if(misc.random(2) == (1)){
    sendMessage("You win 500k!");
    addItem(995, 1000000);
    } else {
    sendMessage("Sorry, you lost your money!");
    }
    } else {
    sendMessage("You do not have the money to gamble.");
    }
    }

    Hope it helps


    --Stu
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2010
    Posts
    112
    Thanks given
    5
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by stuart12 View Post
    Code:
    if (command.startsWith("gamble")) {
    if(playerHasItemAmount(995, 500000)) {
    deleteItem(995, getItemSlot(995), 500000);
    if(misc.random(2) == (1)){
    sendMessage("You win 500k!");
    addItem(995, 1000000);
    } else {
    sendMessage("Sorry, you lost your money!");
    }
    } else {
    sendMessage("You do not have the money to gamble.");
    }
    }

    Hope it helps


    --Stu


    nice. but where do i put it ?
    on comands like this ?
    if(command.startsWith("jad")){
    triggerTele(2475, 5175, 0);
    }


    that is a command..
    Reply With Quote  
     

  5. #5  
    Registered Member MrVidel's Avatar
    Join Date
    Dec 2009
    Posts
    166
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    yeah just add it under that
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •