Thread: Spawning For Cash?

Results 1 to 10 of 10
  1. #1 Spawning For Cash? 
    Registered Member
    Join Date
    Oct 2009
    Posts
    62
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Example 1 kill gets u 100k, you need 200m for chaotics or someshit.

    ty.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Nov 2008
    Posts
    253
    Thanks given
    2
    Thanks received
    7
    Rep Power
    19
    I am not quite sure what you are asking here... Please explain this a little better.
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Dec 2011
    Posts
    438
    Thanks given
    15
    Thanks received
    8
    Rep Power
    0
    ::item 995 2147000000???
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jul 2009
    Posts
    1,875
    Thanks given
    119
    Thanks received
    233
    Rep Power
    408
    hes talking about making it cost money to spawn items
    Reply With Quote  
     

  5. #5  
    Registered Member
    Darna's Avatar
    Join Date
    Jan 2008
    Age
    31
    Posts
    488
    Thanks given
    11
    Thanks received
    4
    Rep Power
    163
    to your item command add something like that

    if (itemid == xxx && playerhasitem(995,xxxx)
    player.additem (xxx,1);
    else
    sendMsg("You need xxx cash to spawn this shit);

    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2008
    Posts
    253
    Thanks given
    2
    Thanks received
    7
    Rep Power
    19
    Quote Originally Posted by sylas View Post
    hes talking about making it cost money to spawn items
    I don't come to the help section to decipher some scrambled version of English. If it gets typed out better, I will be more helpful the first time around.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Oct 2009
    Posts
    62
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    still need help.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jun 2011
    Posts
    220
    Thanks given
    3
    Thanks received
    13
    Rep Power
    2
    If this is what you're asking...
    Code:
    private/*or public*/ int[][] spawningItems() {
    	int[][] result;
    	result = new int[Config.ITEM_LIMIT][2];
    	for(int i = 0; i < result.length; i++) {
    		result[i][0] = i;
    		result[i][1] = Server.itemHandler.ItemList[i].ShopValue;
    	} return result;
    }
    private/*or public*/ boolean canSpawnItem(int itemId) {
    	return (c.getItems().playerHasItem(995, spawningItems()[itemId][1]);
    }
    //put this in appropriate place:
    if(playerCommand.startsWith("item")) {
    	if(c.inWild()) c.sendMessage("You cannot spawn items in the wild"); return;
    	try {
    		String[] args = playerCommand.split(" ");
    		if(args.length == 3) {
    			int itemId = Integer.parseInt(args[1]);
    			int itemAmount = Integer.parseInt(args[2]);
    			if(canSpawnItem(itemId)) {
    				if(itemId <= Config.ITEM_LIMIT && itemId >= 0) {
    					c.getItems().addItem(itemId, itemAmount);
    				}
    			} else {
    				c.sendMessage("You need " + spawningItems()[itemId][1] + " coins to spawn this item.");
    			}
    		} else {
    			c.sendMessage("Wrong usage. Use as: \"::pickup ID Amount\".");
    		}
    	} catch(Exception e) {}
    }
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Quote Originally Posted by Ch3ck it S0n View Post
    If this is what you're asking...
    Code:
    private/*or public*/ int[][] spawningItems() {
    	int[][] result;
    	result = new int[Config.ITEM_LIMIT][2];
    	for(int i = 0; i < result.length; i++) {
    		result[i][0] = i;
    		result[i][1] = Server.itemHandler.ItemList[i].ShopValue;
    	} return result;
    }
    private/*or public*/ boolean canSpawnItem(int itemId) {
    	return (c.getItems().playerHasItem(995, spawningItems()[itemId][1]);
    }
    //put this in appropriate place:
    if(playerCommand.startsWith("item")) {
    	if(c.inWild()) c.sendMessage("You cannot spawn items in the wild"); return;
    	try {
    		String[] args = playerCommand.split(" ");
    		if(args.length == 3) {
    			int itemId = Integer.parseInt(args[1]);
    			int itemAmount = Integer.parseInt(args[2]);
    			if(canSpawnItem(itemId)) {
    				if(itemId <= Config.ITEM_LIMIT && itemId >= 0) {
    					c.getItems().addItem(itemId, itemAmount);
    				}
    			} else {
    				c.sendMessage("You need " + spawningItems()[itemId][1] + " coins to spawn this item.");
    			}
    		} else {
    			c.sendMessage("Wrong usage. Use as: \"::pickup ID Amount\".");
    		}
    	} catch(Exception e) {}
    }
    Damn that code looks ugly...

    Code:
    	if (playerCommand.startsWith("item")) {
    		final String[] args = playerCommand.split(" ");
    		final int itemID = Integer.parseInt(args[1]), amount = (Integer.parseInt(args[2]) > c.getItems().freeSlots() ? c.getItems().freeSlots() : Integer.parseInt(args[2]));
    		final int price = Server.itemHandler.ItemList[itemID].ShopValue * amount;
    		//final String itemName = ItemAssistant.getItemName(itemID); //use if you want item name in sendMessage
    		if (amount <= 0)
    			return;
    		if (!c.getItems().playerHasItem(995, price)) {
    			c.sendMessage("You need " + price + " gold pieces to spawn this item."); //to spawn " + amount + itemName + (amount > 1 ? "s" : ""));
    			break;
    		}
    		c.getItems().deleteItem(995, c.getItems().getItemSlot(995), price);
    		c.getItems().addItem(itemID, amount);
    	}
    Reply With Quote  
     

  10. Thankful user:


  11. #10  
    Registered Member
    Join Date
    Jun 2011
    Posts
    220
    Thanks given
    3
    Thanks received
    13
    Rep Power
    2
    oh damn i stupid
    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: 10
    Last Post: 03-30-2011, 05:27 AM
  2. Membi ship for rs cash/ irl cash for rs cash.
    By `moh in forum Gold & Items
    Replies: 1
    Last Post: 02-03-2011, 02:28 AM
  3. Replies: 3
    Last Post: 04-15-2010, 09:09 AM
  4. Replies: 6
    Last Post: 07-02-2009, 06:24 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
  •