Addlibs

Members
  • Content Count

    957
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Addlibs

  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
  16. I'm pretty sure you can safely delete them (though I'd advise just moving them into a seperate directory at first if you believe you want to migrate at least some of the data from there at some point) and start up the server, which should generate new internal.db and registry.db files, without any data.
  17. Addlibs

    Mta Account

    First of all, you've linked an empty pastebin. Secondly, you should check /debugscript 3 ingame both at the time of starting the resource and at the point it's supposed to do something, and tell us if there's any debug errors popping up with the resource's name. If so, please tell us what these are.
  18. Easy mistake. You're applying the wanted level to the wrong element (to the account instead of the player) Line 13 should be setTimer (setPlayerWantedLevel,500,1,source,wantedLevel)
  19. Addlibs

    (HELP) Nametag

    This isn't a requests section. We can guide you on how to do it, or help you out with particular patterns or algorithms, but we will not script for you. If you don't want to script it yourself either look through community.mtasa.com or pay someone to script it for you.
  20. Addlibs

    Simple help :D

    function RGBToHex(red, green, blue, alpha) -- Make sure RGB values passed to this function are correct if( ( red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 ) or ( alpha and ( alpha < 0 or alpha > 255 ) ) ) then return nil end -- Alpha check if alpha then return string.format("#%.2X%.2X%.2X%.2X", red, green, blue, alpha) else return string.format("#%.2X%.2X%.2X", red, green, blue) end end From MTA wiki useful functions, by NeonBlack
  21. This is a question for you. How do you want to the spawn location chosen? At random? If so, you'll want to use math.random between 1 and the number of spawn points you have, and then take the coordinates for that index. E.g. local spawns = { {x1, y1, z1}, {x2, y2, z2}, ... } -- later in the code when you're actually spawning local spawnIndex = math.random(1, #spawns) -- select a random index between 1 and number of spawns local spawnX, spawnY, spawnZ = spawns[spawnIndex][1], spawns[spawnIndex][2], spawns[spawnIndex][3] -- collect it's first, second and third parameters (x, y and z position)
  22. mysql_ping is part of an external module called MTA-MySQL, which is essentially deprecated at this point. It's way too old and I do not recommend using it. There are newer, better, built-in alternatives like dbConnect, dbQuery, etc. You should change the script's calls to those functions with the newer built-in (non module-based) functions.
  23. You're setting everyone's look-at coordinates to the centre of the localPlayer's screen, not the respective player's screen. Also, last time I used setPedLookAt, it didn't work for remote players correctly. Also, read the Wiki notices (specifically the first one - don't run this on onClientRender): Note: Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning. Note: For remote players, you have to use setPedAimTarget before setPedLookAt.
  24. Share the code that you need help with, or at least tell us which script it is if it's from MTASA community resources website.
  25. Using setAccountData you run the risk that items may get duplicated, since there is no protection against an item being listed in the account data of two accounts. Using a central MySQL (external) or sqlite (internal) database table, you could avoid this by having one list of items and who they belong to, rather than seperate lists per account.