View Single Post
  #6  
Old 03-26-2011, 09:14 PM
mrnothersan mrnothersan is offline
Owner of MrNothersan
Join Date: Mar 2011
Location: On the Computer
Posts: 97
mrnothersan is an unknown quantity at this point
Send a message via AIM to mrnothersan Send a message via MSN to mrnothersan
Quote:
Originally Posted by WhiteDragon View Post
Then simply change onWeaponFired to onCreated, and make sure everyone gets that weapon when they login.

Putting code in a class doesn't do anything at all. To use a class, you need to join the class to a weapon or NPC. You can think of your classes as a library of useful snippets of code.

Basically, you need to start everything in a weapon or NPC, and you can pull stuff from classes inside the weapon or NPC.
Hey

This is the code I have in Classes:

PHP Code:
public function drawGUI() {
new 
GuiWindowCtrl("Test_Window") {
  
profile = GuiBlueWindowProfile;
  
x = 10;
  
y = 10;
  
width = 160;
  
height = 80;
  
text = "Window";
} 
Where do I put this code:

PHP Code:
function onCreated()
  
this.join("yourclassgoeshere");
//#CLIENTSIDE
function onCreated() {
  
drawGUI(); //calls function in class
} 
Thanks
Reply With Quote