Thread: Weapon -> Class
View Single Post
  #4  
Old 01-24-2010, 07:40 PM
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
I personally just do the following:

Class Script:

PHP Code:
//#CLIENTSIDE
function onInitGUI() {
  
createGUI();

Weapon script:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.scheduleevent(0.05"InitGUI""");

I know for developing purposes you want to update it, and see the changes immediately but in the end you should be aiming for creating it only when it's needed.

I.e:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.join("gui_design");
}

function 
onWeaponFired() {
  if (!
isGUICreated()) {
    
createGUI();
  }
  
toggleGUI();

__________________
Quote:
Reply With Quote