Blockland Forums > Suggestions & Requests
Inventory search
Blocki:
You forgot to package
You forgot to use uinmes
MARBLE MAN:
--- Quote from: Blocki on November 16, 2012, 06:31:57 PM ---You forgot to package
You forgot to use uinmes
--- End quote ---
is packaged dumbass
Heres some uinames
Script_PlayerSearch:
Use: Displays the UI Names of the items of the player you click. (Alternate ItemClick)
Command: N/A
Download:Script_PlayerSearch.zip
--- Quote from: Alpherio on November 16, 2012, 02:25:51 PM ---This breaks activating. Did you even test this?
Do you test anything you make?
All of your mods I tried breaks horribly or doesn't work right
--- End quote ---
Will fix Fixed!, did test, realised after releasing :p (also was 1 am)
Daenth:
--- Quote from: MARBLE MAN on November 16, 2012, 07:40:25 PM ---is packaged dumbass
Will fix Fixed!, did test, realised after releasing :p (also was 1 am)
--- End quote ---
By packaged he means this:
--- Code: ---package (NAME) {
};
--- End code ---
You're missing this in your code. Your script still breaks ::activateStuff(%this); because your parent is not packaged and parents don't work unless they are put into packages.
MARBLE MAN:
--- Quote from: Daenth on November 17, 2012, 12:51:28 AM ---By packaged he means this:
--- Code: ---package (NAME) {
};
--- End code ---
You're missing this in your code. Your script still breaks ::activateStuff(%this); because your parent is not packaged and parents don't work unless they are put into packages.
--- End quote ---
oh... will do tomorrow
Port:
package show_items_on_click
{
function player::activateStuff( %this )
{
parent::activateStuff( %this );
if ( !isObject( %cl = %this.getControllingClient() ) )
{
return;
}
%start = %this.getEyePoint();
%direction = %this.getEyeVector();
%path = vectorScale( %direction, 5 );
%stop = vectorAdd( %start, %path );
%ray = containerRayCast( %start, %stop, $TypeMasks::All, %this );
%col = firstWord( %ray );
if ( !isObject( %col ) )
{
return;
}
if ( !( %col.getType() & $TypeMasks::PlayerObjectType ) )
{
return;
}
%max = %col.getDataBlock().maxTools;
for ( %i = 0 ; %i < %max ; %i++ )
{
%name = %col.tool[ %i ].uiName;
if ( !strLen( %name ) )
{
return;
}
%items = %items @ ( strLen( %items ) ? "\n" : "" ) @ "\c3" @ %name;
}
if ( strLen( %items ) )
{
%cl.centerPrint( %items, 3 );
}
else
{
%cl.centerPrint( "\c3This player has no items.", 3 );
}
}
};
activatePackage( "show_items_on_click" );