View Single Post
  #1  
Old 05-09-2009, 11:38 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Object functions...

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
obj.testfunct();
}

function 
obj.testfunct() {
  
player.chat "hi";

This does not work, you can't trigger your own functions onto other objects. However, you can do this and it works just fine:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
obj.testfunc();
}

obj.testfunc = function() {
  
player.chat "hi";


So for further example:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowControl("lalala") {
    
width height 50;
    
50;
    
profile GuiBlueWindowProfile;
  }
  
lalala.hi();
}

function 
lalala.hi() {
  
player.chat "hello";

This does not work. Neither does this:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowControl("lalala") {
    
width height 50;
    
50;
    
profile GuiBlueWindowProfile;
    
thiso.catchEvent(this"hi""LALA123");
  }
  
lalala.hi();
}

function 
LALA123() {
  
player.chat "hello";

This doesn't work either:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowControl("lalala") {
    
width height 50;
    
50;
    
profile GuiBlueWindowProfile;

    
this.hi = function() {
      
player.chat "hi";
    }
  }
  
lalala.hi();

However, this works fine:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowControl("lalala") {
    
width height 50;
    
50;
    
profile GuiBlueWindowProfile;
  }

  
lalala.hi = function() {
    
player.chat "hello";
  }

  
lalala.hi();

However, none of these problems occur serverside. So... yeah.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote