Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.