Thread: spawning help

Results 1 to 5 of 5
  1. #1 spawning help 
    Banned
    Join Date
    Feb 2014
    Posts
    348
    Thanks given
    18
    Thanks received
    17
    Rep Power
    0
    How do i make the :ickup and ::item to be only for someone who has rights:3?
    here my coding on commands atm... someone help please

    }
    if (playerCommand.startsWith("item")) {
    try {
    String[] args = playerCommand.split(" ");
    if (args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 25000) && (newItemID >= 0)) {
    c.getItems().addItem(newItemID, newItemAmount);
    System.out.println("Spawned: " + newItemID + " by: "
    + c.playerName);
    } else {
    c.sendMessage("No such item.");
    }
    } else {
    c.sendMessage("Use as ::item 995 200");
    }
    } catch (Exception e) {
    }
    }




    -------------------------------------------------------------------



    }
    if (playerCommand.startsWith("pickup")) {
    try {
    String[] args = playerCommand.split(" ");
    if (args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if ((newItemID <= 25000) && (newItemID >= 0)) {
    c.getItems().addItem(newItemID, newItemAmount);
    System.out.println("Spawned: " + newItemID + " by: "
    + c.playerName);
    } else {
    c.sendMessage("No such item.");
    }
    } else {
    c.sendMessage("Use as ::item 995 200");
    }
    } catch (Exception e) {
    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Member r0fl dr0pped's Avatar
    Join Date
    Feb 2012
    Posts
    394
    Thanks given
    20
    Thanks received
    5
    Rep Power
    23
    if (playerCommand.startsWith("item") && (c.playerRights >= 2)) {
    OR
    && c.playerRights == 3) {
    It's one of the two.
    Thanks would be appreciated
    Reply With Quote  
     

  3. #3  
    ¦¦¦ RuneTimes ¦¦¦

    RainDropzZ's Avatar
    Join Date
    Oct 2010
    Posts
    389
    Thanks given
    31
    Thanks received
    108
    Rep Power
    556
    lets get abit more in detail, as r0fl dr0pped said, you use,
    Code:
     c.playerRights == 3
    so the number in the end defines the right Number, normaly 0 is a normal player, 1 is moderator or short mod, 2 administrator or short admin, and 3 is owner, after that it depends on the certain source you are using, feel free to play around.
    So this code:
    Code:
     c.playerRights == 3
    makes it owner only, the double = is important, you can change it with these chars: !, < or > these can change the range of rights like :
    Code:
     c.playerRights >= 3
    would be that if the playerrights are bigger then or 3 the player would be able to use the command.
    Code:
     c.playerRights <= 3
    would be that if the playerrights are smaler then or 3 the player would be able to use the command.
    Code:
     c.playerRights != 3
    would be that if the playerrights are NOT 3 the player would be able to use the command.
    hope it helped you a bit
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2014
    Posts
    6
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Got skype? add me and i'll help you with this and anything you need in the future.

    Skype: vespula_hf
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Feb 2014
    Posts
    348
    Thanks given
    18
    Thanks received
    17
    Rep Power
    0
    its ok fixed it
    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. [562] Equipment And Spawning Help.
    By kieran in forum Requests
    Replies: 4
    Last Post: 10-01-2009, 10:21 AM
  2. Espeon 508 bank booth spawning (Help)
    By Teh Failed Pkz in forum Help
    Replies: 2
    Last Post: 07-23-2009, 09:58 AM
  3. 508 espeon spawn help.
    By Ep1c H3r0 in forum Help
    Replies: 2
    Last Post: 06-04-2009, 11:05 AM
  4. Global object spawning help
    By linkey in forum Help
    Replies: 0
    Last Post: 04-29-2009, 11:46 PM
  5. spawn help for 508
    By The Awakener in forum Help
    Replies: 4
    Last Post: 02-15-2009, 01:32 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
  •