02-18-2013, 01:44 AM
PHP Code:
string name = "Package";
integer type = INVENTORY_ALL; // INVENTORY_NOTECARD, INVENTORY_LANDMARK, INVENTORY_OBJECT, ETC, ETC
string password = "porcamadona";
integer channel = 30;
integer pchannel = 31;
//-------------------------------------------
default
{
state_entry()
{
llSetObjectName( name + " Distributor" );
llSetObjectDesc( "Geezmo Distributor v0.1" );
llSetText( "Touch me to get\n" + name, <1.0, 1.0, 1.0>, 1.0 );
llListen( channel, "", "", "" );
llListen( pchannel, "", llGetOwner(), "" );
}
touch_start(integer total_number)
{
if ( llDetectedKey( 0 ) == llGetOwner() )
{
llOwnerSay( "\nThe current password is: " + password +
"\nIf you wanna change it, you have to type on channel " +
(string)pchannel + " the new password." );
} else {
llWhisper( 0, "You must type the right password on channel " +
(string)channel + " in order to get the package box." );
}
}
listen( integer _c, string _n, key _i, string _m )
{
if ( _c == channel )
{
if ( _m == password )
{
list content;
integer i;
for ( ; i<llGetInventoryNumber(type); ++i )
{
if ( llGetInventoryName( type, i ) != llGetScriptName() )
content += llGetInventoryName( type, i );
}
llGiveInventoryList(_i, name, content);
}
}
if ( _c == pchannel )
{
password = _m;
llOwnerSay( "The new password is: " + password );
}
}
}
Quote this message in a reply Thanks Quote this post Report this post to a moderator
HideMyAss.com