Advertisement
Jym_Nova

GiveItemByNameToName

Dec 22nd, 2018
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
  2. /*
  3. LICENCE:
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. or you may visit - http://license.idjhost.com/
  17. */
  18. // DESCRIPTION
  19. // Let's you designate delivery of inventory items by name to individuals by name
  20.  
  21. string name1 = "JyM rEsIDeNt";
  22. string item1 = "apple";
  23.  
  24. string name2 = "add_name";
  25. string item2 = "orange";
  26.  
  27. string name3 = "add_name";
  28. string item3 = "banana";
  29.  
  30. string name4 = "add_name";
  31. string item4 = "kiwi";
  32.  
  33. string name5 = "add_name";
  34. string item5 = "dragon fruit";
  35.  
  36. string name6 = "add_name";
  37. string item6 = "pomegranate";
  38.  
  39. search(string find, key in_kId){
  40.     if(llGetInventoryType(find) == INVENTORY_OBJECT)
  41.         llGiveInventory(in_kId, find);
  42.     else
  43.         llRegionSayTo(in_kId, PUBLIC_CHANNEL, "Sorry, we're all out of "+find+"'s");
  44. }
  45.    
  46. default{
  47.     touch_start(integer num_detected){
  48.         string sName = llToLower(llDetectedName(0));
  49.         key kId = llDetectedKey(0);
  50.         if(sName  == llToLower(name1)) search(item1, kId );
  51.         else if(sName  == llToLower(name2)) search(item2, kId );
  52.         else if(sName  == llToLower(name3)) search(item3, kId );
  53.         else if(sName  == llToLower(name4)) search(item4, kId );
  54.         else if(sName  == llToLower(name5)) search(item5, kId );
  55.         else if(sName  == llToLower(name6)) search(item6, kId );
  56.         else llRegionSayTo(kId ,PUBLIC_CHANNEL, "You're not in the list, you get nothing.");
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement