-
Posts
1,060 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Addlibs
-
Your problem is that the function getResponsiveSize isn't defined.
- 2 replies
-
- loginpanel
- gta
-
(and 2 more)
Tagged with:
-
You likely won't be able to intercept these messages as MTA's network communication is encrypted Server_mtaserver.conf#networkencryption and the ability to disable it was removed in commit 4e89dd81e0914a30688941768c0c3dfe104727f4 over 5 years ago. The actual encryption of network communications happens within the closed-source net.dll file. Even if you were to manage to decrypt somehow, you'd still need to copy and keep up-to-date headers for the packets (Packets.h and packetenums.h and additionally most, if not all, external dependencies those files have), as the packets aren't named in the payload, but rather numbered, and the definitions for which ID refers to which packet may (though probably won't, but making this assumption isn't a good idea) change in the future.
-
When creating a browser you need to specify 'true' for the isLocal parameter to be able to load local files.
-
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.
-
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.
-
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.
-
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.
-
getRealTime returns the hour in 24-hour format, from 0 to 23
-
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.
-
I'm not sure but I never had problems with conversions from .map to Lua code which is what I used it for mostly
-
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
-
Is everyZombie and newZombieLimit defined anywhere?
-
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
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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)
-
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.multitheftauto.com or pay someone to script it for you.
-
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
-
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)
-
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.
-
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.