View Single Post
  #6  
Old 08-04-2008, 06:50 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
This is what we do on Vesporia:

PHP Code:
join( "functions_gui" );
//#CLIENTSIDE
function onCreated()
{
  
showMenu();
}
function 
showMenu()
{
  
profile = "vspWindow";
  
  
width = 300;
  
height = 300;
  
  
center();
  
setVars();
  
  
text = "hehe window";
} 
The functions basically look like this:

PHP Code:
//#CLIENTSIDE
function center()
{
  
// how to center
} 
Think of a class as a set of functions added onto the script.

If I have a class that does this:
PHP Code:
function foo()
{
   return 
true;
} 
and a script that does this:

PHP Code:
join( "myclass" );
function 
onCreated()
{
  echo( 
foo() );
} 
Then you can think of it like this:

PHP Code:
function onCreated()
{
  echo( 
foo() );
}
function 
foo()
{
   return 
true;
} 

You can use this. to work with the object whether it is joined to a player or an NPC.

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
this.chat = "hi";
} 
That will work whether joining to an NPC or a player.
__________________
Reply With Quote