View Single Post
  #14  
Old 01-16-2010, 04:34 AM
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
You can't make actual objects/object types, whatever you want to call them, but you can make TStaticVars, set variables, and join classes to them to do most of what you probably want to do.

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
CheeseLocation = new TStaticVar();
  
CheeseLocation.join("CheeseLocation");

and in the class CheeseLocation:

PHP Code:
//#CLIENTSIDE
public function setPosition(xyz) {
  
this.position = {xyz};
}

public function 
getPosition() {
  return 
this.position;
}

// you can even do this to spoof it as an object even further, but there's no real reason to
public function objectType() {
  return 
"CheeseLocation";

Keep in mind there will be a delay between the time obj.join() is called and when the class is actually joined (it doesn't pause the script to wait for it to join).

You can also make new instances of the object you made.

PHP Code:
BigCheese = new CheesePosition();
BigCheese.setPosition(130);

SmallCheese = new CheesePosition();
SmallChese.setPosition(041); 
A bit of a workaround but it works.

EDIT: oops, didn't notice the second page of the thread
__________________
Reply With Quote