02-07-2007 19:26
Hi m8s,

Im trying do adapt a code, but i dont know whats happening.

The Boolean choice is working fine, but when i tryed to use de llGiveInventory nothing happens.

CODE

integer CHANNEL = 42; // dialog channel
list MENU = ["Yes", "No"]; // boolean menu

default {
state_entry() {
llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users)
}
touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "ABSOLUT LEGAL. Are you of legal drinking age?", MENU, CHANNEL); // present dialog on click
}


listen(integer channel, string name, key id, string message)
{
string response_string;

if (llListFindList(MENU, [message]) != -1) // verify dialog choice
{
response_string = name + " picked the option '" + message + "'.";
if (message == "Yes")
llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_OBJECT, 0));
else if (message == "No")
llSay(0, "Have fun!");
}
else
{
response_string = name + " picked invalid option '" + llToLower(message) + "'.\n";
response_string = response_string + "Click for options";
}

}
}



Plz, can someone help me?

Tanks