View Single Post
  #6  
Old 02-19-2013, 04:29 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Sorry for bumping this (it has been a year ), but I've been attempting this method to no avail.
I've attempted even Thor's simple example; any other ways to do this? Or am I just doing something incorrectly?

EDIT: FIXED! Thanks to Hoyt1134
In case anyone else has this problem, here's a possible solution based off of ffcmike's example. I instead wanted to send the image of the selected weapon, so I will replace it with what I wanted to do with it:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.images = {};
  for ( 
temp.i = 0; temp.i < player.weapons.size(); temp.i ++ ) {
    
thiso.images.add( player.weapons[ temp.i ].image );
    new 
GuiShowImgCtrl( "test" @ temp.i ) {
      
y = 55;
      
x = 50 + temp.i * 40;
      
image = player.weapons[ temp.i ].image;
      
thiso.catchEvent( this.name, "onMouseDown", "onSelect" );
    }
  }
}
function 
onSelect( temp.gui ) {
  
temp.gui = temp.gui.substring( 4 );
  
temp.image = this.images[ temp.gui ];
  
player.chat = temp.image;
} 
Again, sorry for the bump, but this may be useful for others as catchEvent() does not include parameters... Maybe a useful addition?

Last edited by devilsknite1; 02-19-2013 at 05:21 AM..
Reply With Quote