OsGiveLinkInventory

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Translated comments)
 
Line 4: Line 4:
 
|delay=3|function_syntax=osGiveLinkInventory(integer linkNumber, key destination, string inventory)<br>
 
|delay=3|function_syntax=osGiveLinkInventory(integer linkNumber, key destination, string inventory)<br>
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
// Beispiel für osGiveLinkInventory
+
// Example for osGiveLinkInventory
// In diesem Skript wird die Funktion osGiveLinkInventory verwendet, um den Gegenstand mit dem Namen GEGENSTANDSNAME
+
// This script uses the osGiveLinkInventory function to give the specified inventory from the specified link to a specified avatar
// aus dem Inventar der Unterprim mit der Nummer CHILD_PRIM_NUMBER an den Avatar mit dem Schlüssel ZIEL_AVATAR_SCHLÜSSEL zu übergeben.
+
// Note: The variables have to be replaced with their actual values, the used names are just placeholders
// Bitte beachten Sie, dass Sie die entsprechenden Werte für ZIEL_AVATAR_SCHLÜSSEL und GEGENSTANDSNAME durch die tatsächlichen Werte ersetzen müssen,
+
// die Sie verwenden möchten.
+
  
// Definiere die Nummer der Unterprim, die das Inventar enthält
+
// Define the link number to search for the inventory item
 
integer CHILD_PRIM_NUMBER = 2;
 
integer CHILD_PRIM_NUMBER = 2;
 +
// Define the avatar, by key, to which to give the item
 +
key targetAvatar = "TARGET_KEY";
 +
// Define the item by name
 +
string itemName = "INVENTORY_NAME";
  
// Event handler, der aufgerufen wird, wenn das Skript startet
+
// Event handler, that is executed on script start
 
default
 
default
 
{
 
{
 
     state_entry()
 
     state_entry()
 
     {
 
     {
         // Speichere die Schlüssel des Ziels und den Namen des Gegenstands, der übergeben werden soll
+
         // Run the osGiveLinkInventory function with parameters to hand the specified item over
        key targetAvatar = "ZIEL_AVATAR_SCHLÜSSEL";
+
        string itemName = "GEGENSTANDSNAME";
+
 
+
        // Führe die Funktion osGiveLinkInventory aus, um den Gegenstand zu übergeben
+
 
         osGiveLinkInventory(CHILD_PRIM_NUMBER, targetAvatar, itemName);
 
         osGiveLinkInventory(CHILD_PRIM_NUMBER, targetAvatar, itemName);
 
     }
 
     }

Latest revision as of 16:39, 26 February 2024

osGiveLinkInventory(integer linkNumber, key destination, string inventory)
Give an item located in a child prim inventory.
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 3 seconds
Example(s)
// Example for osGiveLinkInventory
// This script uses the osGiveLinkInventory function to give the specified inventory from the specified link to a specified avatar
// Note: The variables have to be replaced with their actual values, the used names are just placeholders
 
// Define the link number to search for the inventory item
integer CHILD_PRIM_NUMBER = 2;
// Define the avatar, by key, to which to give the item
key targetAvatar = "TARGET_KEY";
// Define the item by name
string itemName = "INVENTORY_NAME";
 
// Event handler, that is executed on script start
default
{
    state_entry()
    {
        // Run the osGiveLinkInventory function with parameters to hand the specified item over
        osGiveLinkInventory(CHILD_PRIM_NUMBER, targetAvatar, itemName);
    }
}
Notes
This function was added in 0.9.3.0


Personal tools
General
About This Wiki