Jump to content

Skurken

Members
  • Posts

    16
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Skurken's Achievements

Square

Square (6/54)

1

Reputation

  1. Isn't a one file better than 16 separate files? Also, only one message is output to chatbox and that's if the use clicks proceed with the edit empty, and it should be easy to modify.
  2. You can send a the vars to server-side. triggerServerEvent('event', root, variable)
  3. Skurken

    What is MySQL?

    You do make a good point.
  4. Skurken

    What is MySQL?

    You're probably more experienced than I am but, isn't the answer to MySQL's usefulness somewhat misleading? You can use MySQL to store data, like accounts for example, even if you don't need to integrate a website or a forum, MySQL can be used instead of SQLite to store data.
  5. Actually it's triggerServerEvent that he needs. triggerServerEvent
  6. I can add that for createInputPrompt, maybe with a limit or switch to scrollpane if more than a certain quantity of edits. As for your other suggestion, I can try to do something like that. local edit = Edit(width, text) -- Maybe a label argument to add a label before the edit local button = Button(width, text, 'right') -- right is the alignment And the window should be re-sized to fit the elements. Thanks.
  7. This is one of my personal libraries that I use. I thought of sharing it, someone might find it useful. To be able to use it you have to include one script file to your resource (in meta.xml) Some examples: local wnd = Window(100, 100, 400, 400, 'Window') wnd:Alpha(1) wnd:Sizable(false) wnd:Visible(false) wnd:Destroy() -- Instead of specifying the x, y you can simply use 'center' and it will automatically calculate the x, y according to the width/height. -- Same example as the window above, only that it is centered local wnd = Window('center', 400, 400, 'Window') -- Other elements local btn = Button(100, 100, 100, 40, 'Button', false, wnd) -- You just send the returned value of Window btn:AddOn('Click', function(button, state) outputChatBox'Clicked' end) local img = Image(100, 100, 128, 128, 'path', false, wnd) img:LoadImage('another path') local cmb = ComboBox(100, 100, 200, 200, 'Caption', false, wnd) cmb:AddItems('Item 1', 'Item 2', 'Item 3') -- Just keep passing arguments to add more items local selected = cmb:Selected() -- Gets the selected item index cmb:Selected(0) -- Sets the selected item index to zero (first item) cmb:AddOnAccepted(function(combobox) outputChatBox'New Item Selected' end) cmb:AdjustHeight(3) -- 3 is the item count so the function can calculate the adjusted height, credits to Remi-X for the useful function. local edit = Edit(100, 100, 100, 40, 'Text', false, wnd) edit:Masked(true) edit:ReadOnly(true) edit:MaxLength(24) edit:AddOnChanged(function() outputChatBox('New text: ' .. edit:Text()) end) local list = GridList(100, 100, 200, 200, false, wnd) list:AddColumn('Column 1', 0.4) list:AddColumn('Column 2', 0.4) list:AddRow('Item 1 under Column 1', 'Item 2 under Column 2') -- Add more items according to column count list:Clear() local prg = ProgressBar(100, 100, 100, 40, 'Progress Label', false, wnd) -- You can specify a progress bar label and it will be automatically updated to reflect the progress -- For the above example a label will be created above the progress bar saying Progress Label: 0% in Red, if progress is 60% then it will say Progress Label: 60% in Orange, if the progress is 80% the label will say Progress Label: 80% in Green prg:Progress(80) -- Sets the progress local progress = prg:Progress() -- Gets the progress local label = Label(100, 100, 100, 100, 'Text', false, wnd) label:Color(255, 0, 0) label:HorizontalAlign('center', true) There are three useful functions that I've added: createAlert('Alert text') -- Creates a centered window, a centered label on the window and a button to close the window. createYesNoPrompt('Do you like me?', function() outputChatBox'Yes button pressed' end, function() outputChatBox'No button pressed' end) -- Like the alert window but with a yes/no buttons, second argument is the yes button callback, third one is the no button callback createInputPrompt('Input your name', function(text) outputChatBox('Hello ' .. text) end) -- A window, with an edit to input something, second arg is a callback when the button is clicked, the edit is automatically checked for emptiness I will provide later a more detailed list of functions available. Credits to Remi-X for the guiComboBoxAdjustHeight useful function. Credits to 50p for some ideas from his gui library. Community GitHub
  8. Translations are only loaded once the resource starts, a table is then created and used from that point on. I do believe that managing translations in an xml format is easier than tables.
  9. That was one of the main reasons I thought of making this, multi-lingual GUIs. It's a very small script.
  10. Who said anything about google translate?
  11. This is a very small script that allows you to easily implement multilinguality in your scripts and interfaces. You edit translations.xml to add more translated strings, as this example shows: <translations> <language name='English'> <string id='HELLO' text='Hello'/> </language> <language name='Catalan'> <string id='HELLO' text='Hola'/> </language> </translations> Then in your script you can do: local catalan = exports.translations:getTranslationTable('Catalan') print (catalan.HELLO) -- Outputs Hola --OR local langs = exports.translations.getTranslationTable() print (langs.Catalan.HELLO) Community GitHub
  12. I didn't understand a thing but you don't need a module to operate with databases. MTA already has several functions to do that. dbConnect dbQuery dbExec dbPoll dbFree
  13. onPlayerDamage gets triggered on every hit so the wanted level is incremented on each hit. You can use onPlayerWasted to only increment wanted level on wasted.
  14. That's just a desktop application that still uses the online compiler to function.
  15. I'm not entirely sure but I think you can send the string sent to onPlayerScreenShot to a web page using callRemote.
×
×
  • Create New...