Quote:
Originally Posted by WhiteDragon
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