Spaces, spaces everywhere!
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" );