Thread: Pickup

Results 1 to 4 of 4
  1. #1 Pickup 
    Registered Member
    Join Date
    May 2010
    Posts
    14
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    I want to write a :: pickup method that allows me to restrict items for normal players to spawn.... how would I do this? Delta Base.

    Also, how anyone have the command :: setlevel?
    Reply With Quote  
     

  2. #2  
    Donator
    Garrett's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    350
    Thanks given
    45
    Thanks received
    21
    Rep Power
    28
    Why not set after the command

    pickupcommandddddd here
    }
    }
    Else if item(id==####)
    pickup=false;
    sM("You are not allowd to pickup this item");

    This is just and example i know it might be wrong (:

    Code:
    if (command.startsWith("pickup")) {
    	String ItemName = command.substring(7);
    	ItemName = ItemName.replaceAll("_", " ");
    	for(int i = 0; i < 8000; i++) {
    		if(getItemName(i).toLowerCase().equalsIgnoreCase(ItemName.toLowerCase())) {
    			addItem(i, 1);
    			sM("Item Added");
    			return;
    		}
    	}
    	sM("No item called "+ItemName+" is found.");
    }
    }
    Else item(id==###)
         pickup=false;
       sM("you are not allowed to pickup this item");
    }
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2010
    Posts
    14
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Quote Originally Posted by GarrettRawr View Post
    Why not set after the command

    pickupcommandddddd here
    }
    }
    Else if item(id==####)
    pickup=false;
    sM("You are not allowd to pickup this item");

    This is just and example i know it might be wrong (:
    Yeah I think that's wrong, I was going to write an array and I got that all up and working but when I try to make it where if the newItemID = the array you need to be a donator to spawn this item, it throws an error that says tha you can't compare ints and arrays. Then I tried to make the newItemID command an array so they be compared but, it didn't work because addItem does not work with arrays. So now I'm lost!

    P.S.: That wouldn't work because that is after the fact and it already spawned the item for the player.
    Reply With Quote  
     

  4. #4  
    Donator
    Garrett's Avatar
    Join Date
    May 2010
    Age
    29
    Posts
    350
    Thanks given
    45
    Thanks received
    21
    Rep Power
    28
    hmmm
    now in a bit stumped D:

    what if you add player rights at the end for specific rights?
    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
  •