Author Topic: Inventory search  (Read 2569 times)

I'm thinking, An item that you click on a player with and it lists what the items/weapons/tools they have?

I'm thinking, An item that you click on a player with and it lists what the items/weapons/tools they have?


Why here you go:
http://forum.blockland.us/index.php?topic=212877.0

Script_ItemClick:
Use: Displays the items of the player you click.
Command: N/A
Download:Script_ItemClick.zip


Fixed :D
« Last Edit: November 16, 2012, 07:50:04 PM by MARBLE MAN »

Why here you go:
http://forum.blockland.us/index.php?topic=212877.0

Script_ItemClick:
Use: Displays the items of the player you click.
Command: N/A
Download:Script_ItemClick.zip
[img width=600 height=300]http://i.imgur.com/YBH6j.png[/img]

Why can't you display the UI names? It'd be much more friendly.

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

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
Can agree. We tried this on our server to prevent users from freekilling everyone.
We cant even click on our doors to open them.

You forgot to package
You forgot to use uinmes

You forgot to package
You forgot to use uinmes
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


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
Will fix Fixed!, did test, realised after releasing :p (also was 1 am)
« Last Edit: November 16, 2012, 07:50:27 PM by MARBLE MAN »

is packaged dumbass

Will fix Fixed!, did test, realised after releasing :p (also was 1 am)

By packaged he means this:
Code: [Select]
package (NAME) {
};

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.

By packaged he means this:
Code: [Select]
package (NAME) {
};

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.
oh... will do tomorrow

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" );