![]() |
Classes with guis
Ok, so, I am trying to make a sale system. Its just a basic gui that displays the item name, image, and a buy or cancel button.
The only thing is, I cant get it to display data. >< My npc in the level: HTML Code:
this.join("shops"); HTML Code:
//#CLIENTSIDE |
text = this.itemname;
? |
Well, why do you have the onCreated event in there man you don't need that. :) Just use mouse down as well instead of on action mouse. Give me a few moments to fix that up for you.
PHP Code:
|
Your problem is simply that the class needs to be joined clientside:
NPC Code: |
Ok, killer, all you did was change the mouse down part, and it didnt work.(the gui wouldnt even show. -.-)
Jk, your meathod didnt work either. =/ |
I see a few typos:
Quote:
|
When you do just this.itemname, without @ it appears as 0.
And it doesnt matter is height = 1 or 60, it still doesnt show. |
It doesn't matter the outcome, there's no need for the @.
|
So, why wont it show then? ><
I have tried everything. >_< It has to do with the gui, cause in the class, if you put say2(this.itemname); or message(this.itemname); it shows the correct data. But when you try in a gui, it just doesnt work. |
Use thiso.itemname for GUI Controls
|
Quote:
|
Omg!
It was that simple!? Now I feel like a complete idiot. -.- |
Yeah, when you are editing variables inside a control its pretty much like 'this.variable = value;'
To go outside of the current control you must use the thiso. prefix |
I was reading this thread from the top going, "oh come on!" ^^. Whenever you are using with (obj) { or new obj {, you are no longer accessing the original object so using this. won't find your original values. thiso. uses the original object you were working from.
|
One last thing. ><
I cant get the weapon to add to the player. =/ I have tried everything....whats wrong with this? HTML Code:
//#CLIENTSIDE HTML Code:
function onActionServerside(){ |
All times are GMT +2. The time now is 05:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.