View Single Post
  #1  
Old 05-24-2011, 09:22 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
Doing this is cool too:

PHP Code:
// In a weapon or class:
function onCreated() {
  
this.db findnpc("Your Favorite DB for this kind of thing");
}

function 
otherCode() {
  
this.db.yeehaw();

or

PHP Code:
// In the DB:
function onInitialized() {
  
onCreated(); // Called when the NPC-Server starts up.
}

function 
onCreated() {
  
myFavDBlol this;
}

// Anywhere on the server-side:
function otherCode() {
  
myFavDBlol.rofl();

Directly referring to the DB's name kind of bottlenecks your script if you plan to release it for others who might want to use a different name for it.
Reply With Quote