Jump to content

botder

MTA Team
  • Posts

    524
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by botder

  1. Easy way (not "official"): Make a new file and overwrite the 3 functions: outputChatBox, outputDebugString, outputConsole like this: outputChatBox = function() end and copy that file to each (map?) resource, which should stay quiet and add the script to the meta.
  2. Make a resource (e.g. client-api), which has an exported function, which would triggerClientEvent it to the player and then call it (still from that client-api resource). The "client-api" needs 3 parameters: string targetResource, string exportedFunction, table parameters
  3. https://wiki.multitheftauto.com/wiki/OnChatMessage theElement: Player element if chatbox output was done via say, teamsay or me. Resource if it was done via outputChatBox.
  4. @serverside -> clientside The marker hasn't been created clientside yet and the event is faster than the actual marker creation.
  5. You could have mentioned GetResourceExportedFunctions
  6. He is using absolute values: The effect will differ for each amount of fps
  7. Don't base your calculations on the FPS rate!
  8. There will be 2 functions: One function deletes the tab (and keeps the messages) and the second function clears the tab (deletes all the messages, but keeps the tab)
  9. And use https://wiki.multitheftauto.com/wiki/get ... metagColor in your onPlayerChat handler...
  10. Remove both "onPlayerChat" handlers in playercolors and use getPlayerNametagColor in your resource
  11. botder

    string.gsub

    `-` (not greedy) and `+` (greedy) tell the expression to accept 0/1 or more characters, which match `.` (every character). You have to use the not-greedy operator, because it could "eat" the characters beyond the `(` too. Edit: `-` matches 0 or more characters (matches the shortest sequence - not greedy), `+` matches 1 or more characters (matches the longest sequence - greedy)
  12. Had not that much time in the last days. The resource needs refactoring for some parts to avoid code repetition. I added a close text-button (see 2nd image in the first post) and changed the code structure. Just some questions: • Should a tab get auto-created when outputting messages to an unknown tab name (my opinion: no)? • Would you add something to the planned features?
  13. botder

    string.gsub

    local text = "Word(12)" local extracted = text:match(".-%((%d+)%)") http://www.lua.org/pil/20.2.html
  14. Use getLatentEventStatus or show a progress how many files had been downloaded with downloadFile (x from y files)
  15. That function only works on the scriptside, where the latent event has been started. That means you trigger a latent client event on serverside then you can use that handler only serverside, because it's not shared.
  16. Yes, but seperated. It's useful when you have 5 resources, which output debug information, because you have either 5 tabs for each resource or an other tab solution.
  17. Hello everyone. I am scripting a debug console, which should seperate the 3 types, info, warning and error and it allows custom types too. Github: https://github.com/Necktrox/debugconsole Take a look: Features: 3 Standard tabs for info, warning and error Custom tabs for other purposes Pause the debugconsole whenever you want (per tab) Copy the debugmessage on click Switch tabs using mouse You can move the complete window You can scroll with mouse wheel Caches debug messages for tabs, which aren't visible Ability to hide tabs by pressing on a text-button 'X' Scrolling with click-and-move Planned: API
  18. addEventHandler("onClientVehicleCollision", root, function(hitElement) if source == getPedOccupiedVehicle(localPlayer) and hitElement and getElementType(hitElement) == "vehicle" then local driver = getVehicleController(source) local hDriver = getVehicleController(hitElement) end if hDriver and driver then setElementData(driver, "lastcol", hDriver) end end ) driver and hDriver is in an another scope, which means they will be always nil after setting them in the if-scope This is how it should work: local driver, hDriver if source == getPedOccupiedVehicle(localPlayer) and hitElement and getElementType(hitElement) == "vehicle" then driver = getVehicleController(source) hDriver = getVehicleController(hitElement) end if hDriver and driver then setElementData(driver, "lastcol", hDriver) end
  19. I don't know much about freeroam. But you could add minigames, events, arenas, racing, teleports, parkours with vehicles...
  20. Remove the "mtasa://" from the host
  21. There are 2 functions you need to get the decrypted byte code and they are not hidden.
  22. Do you want to get a player by (partial) name?
  23. botder

    GUI Tooltips

    That was only an example code And I am not even sure if the server would apply the element data to a GUI element, which is not known serverside.
×
×
  • Create New...