Dreft Posted June 22, 2009 Share Posted June 22, 2009 I don't want to make new topic every time when i want to ask something so I ask here if i had problems So i start: I get this error: [02:11:19] ERROR: ...RVER THUNDER_FR/mods/deathmatch/resources/efr/fr.lua:39: attempt to call global 'guiCreateWindow' (a nil value) Line 39 is LoginWindow = guiCreateWindow (423,209,376,102,"Prisijunkite...",false) Why this error appears? P.S. To create my GUI i used https://forum.multitheftauto.com/viewtop ... 91&t=22831 this. Waiting for help Link to comment
Remp Posted June 23, 2009 Share Posted June 23, 2009 is your script client side? (as defined in your meta.xml) Link to comment
Dreft Posted June 23, 2009 Author Share Posted June 23, 2009 Oh, there was: <script src="fr.lua"/> so I added this: <script src="fr.lua" type="client" /> and everything working thx. Link to comment
Dreft Posted June 23, 2009 Author Share Posted June 23, 2009 Is there any difference is my game mode has hundreds of resources, or its just in one big *.lua resource ? Link to comment
robhol Posted June 23, 2009 Share Posted June 23, 2009 One .lua file does not a resource make. A resource can contain any number of script files you'll likely need, but for the sake of neatness, I suggest you at least use different .lua files for different things. Functions and variables can be used between files in the same resource completely seamlessly. Inter-resource communication isn't quite that easy (you'll need to export functions, or declare events) although it's hardly a major problem. Ultimately it's up to you, but there's no need to jumble everything up in one massive file like in, for example, SA-MP. Link to comment
Dreft Posted June 23, 2009 Author Share Posted June 23, 2009 One .lua file does not a resource make. A resource can contain any number of script files you'll likely need, but for the sake of neatness, I suggest you at least use different .lua files for different things. Functions and variables can be used between files in the same resource completely seamlessly. Inter-resource communication isn't quite that easy (you'll need to export functions, or declare events) although it's hardly a major problem. Ultimately it's up to you, but there's no need to jumble everything up in one massive file like in, for example, SA-MP. Mhm, ok. http://development.mtasa.com/index.php? ... ng_the_GUI Is this really works ? Because i do everything like here, but when i press button - nothing happens Maybe there is problem in that article ? Link to comment
Thehookerkiller01 Posted June 27, 2009 Share Posted June 27, 2009 function onClientGUIClick ( button, state, absoluteX, absoluteY ) Link to comment
Lordy Posted June 27, 2009 Share Posted June 27, 2009 Dreft, does debugscript say anything? I know when I started learning scripting, that example worked fine Thehookerkiller01, what's that post about anyway? Link to comment
robhol Posted June 27, 2009 Share Posted June 27, 2009 function onClientGUIClick ( button, state, absoluteX, absoluteY ) No. It's an event and you don't call events like that. Until you learn what you're talking about, please do the entire forum a favor and shut the hell up... I've told you this before and, what's worse, I'm pretty sure I'm not the only one who has. Link to comment
Thehookerkiller01 Posted June 27, 2009 Share Posted June 27, 2009 Mhm, ok. http://development.mtasa.com/index.php? ... ng_the_GUI Is this really works ? Because i do everything like here, but when i press button - nothing happens Maybe there is problem in that article ? Just read this.. ;l Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now