Addlibs

Members
  • Content Count

    957
  • Joined

  • Last visited

  • Days Won

    4

Addlibs last won the day on February 10

Addlibs had the most liked content!

Community Reputation

141 Excellent

About Addlibs

  • Rank
    Hoodsta

Details

  • Location
    United Kingdom
  • Occupation
    Scripting Guru

Recent Profile Visitors

3,397 profile views
  1. When creating a browser you need to specify 'true' for the isLocal parameter to be able to load local files.
  2. This event is used by the files mapEditorScriptingExtension_c.Lua and mapEditorScriptingExtension_s.Lua in map resources. Perhaps you've accidentally removed the server (the one ending with _s.Lua) script from the meta.xml and hence the error arose.
  3. You haven't explained what the issue is, but I'm going to guess that the resource simply doesn't turn on when you type /res, and that is likely because you haven't given this resource (the one with this code snippet) ACL permission to function.startResource.
  4. You could create a PHP app that connects to the MTA server through the MTA SDK, letting a user log in using an internal MTA account, and then allow the user to link that account to Discord by using a Discord OAuth2 app that requests permission to the 'identity' scope and then requests and collects the discord account's snowflake ID and passes it onto MTA through the SDK. The OAuth2 app would also be able to collect this information but the email would only be filled if the 'email' scope was also requested.
  5. Addlibs

    Mods Loading

    Have you tried engineSetAsynchronousLoading? That will make mods load in their own time instead of freezing the whole client to load before continuing. Of course this means mod loading will be slower, but it won't freeze the client.
  6. getRealTime returns the hour in 24-hour format, from 0 to 23
  7. Alternatively (a simpler solution that doesn't require tracking loaded players) you can simply have the server tell the client the list of peds to mute when the client is ready and asks for it. That is, [client] -> onClientResurceStart -> triggerServerEvent informing server that client is ready -> [server] -> triggerClientEvent with list of zombies -> [client] -> setPedVoice for each zombie received. This fixes zombies not being muted if the event was received before the client was ready, but it won't suppress the warnings about sending events before the client is ready - for that, you will need to track whether the client is ready before triggering the events.
  8. I'm not sure but I never had problems with conversions from .map to Lua code which is what I used it for mostly
  9. Well that's why the error pops up. You cannot compare an undefined values. You need to define everyZombie and newZombieLimit at the top (or another appropriate place) of the script. everyZombie = {} -- no (empty table) zombies at beginning newZombieLimit = 100 -- or some other value
  10. Is everyZombie and newZombieLimit defined anywhere?
  11. Perhaps you're looking for something like http://gtamap.delux-host.com/converter/. You can convert from a lot of different formats into MTA Lua code or .map XML
  12. Do you know how to inspect HTML? Use the web inspector (Ctrl+Shift+I on Firefox, probably similar on Chrome) built into your browser, specifically the picker tool (Ctrl+Shift+C on Firefox, not sure what it is on Chrome) which lets you click an element to jump to it's HTML lines. Click the table, and copy-paste the HTML of it here.
  13. Depends. Is it your own website? Does the website have an API that would make this easier? If it's a no to both, then you'll need to use fetchRemote to collect the HTML code, find the table element and parse it yourself. An API would be a lot easier though. If you own the website you can make your own API.
  14. Isn't that exactly what he wants? Cleaning (not defragmenting) can be achieved by removing those files (either by deleting or moving somewhere else - as I stated in the previous post, I recommend the latter) and starting up the server to generate new blank DB files. The point is you don't actually have to completely delete the whole server to start fresh, you just need to wipe the databases by removing them; and you don't "download cleaned" files, you let the server generate new, blank, DBs if you want to remove all of the data in them. This is very true. It would be wise to wipe the contents of directories with dynamically filled content, and perhaps reset configurations but I guess the reason one would want to wipe the database without wiping the server directory is to keep resources and configurations.
  15. That's because you call getPlayerCount when you create the string, and you created the string only at start time. What you probably want is MensagensInfo = { "There are #FF0000\(plrCount)#FFFFFF players in the server", "Welcome the server", } and then change line 9 to the following lines: message = MensagensInfo[math.random(1, #MensagensInfo)] -- select a random line from MensagensInfo table message = message:gsub("\%(plrCount%)", getPlayerCount()) -- replace \(plrCount) with current player count (has no effect if \(plrCount) isn't present in the string) outputChatBox(message, getRootElement(), 255, 255, 255, true) -- output the replaced string