Thread: TShowImg ?
View Single Post
  #4  
Old 04-01-2011, 06:49 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
The thing about GUIs is that you create them first, then update/edit them later. I.e:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
createGUI();
  
setTimer(0.05);
}

function 
createGUI() {
  for (
temp.0temp.player.fullheartstemp.i++) {
    new 
GuiShowImgCtrl("GUIHearts_" temp.i) {
      
// hearts and stuff
    
}
  }
  
this.lastfullhearts player.fullhearts;
}

function 
onTimeout() {
  
// Check for change in full hearts
  
if (this.lastfullhearts != player.fullhearts) {
    
// Re-create GUI
    
createGUI();
  }
  
// Update hearts
  
for (temp.0temp.player.fullheartstemp.i++) {
    
// Toggle Heart Visibility
    
(@"GUIHearts_" temp.i).visible = (player.hearts >= temp.i);
  }
  
setTimer(0.05);

__________________
Quote:

Last edited by fowlplay4; 04-01-2011 at 07:11 AM..
Reply With Quote