-
Posts
6,058 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
Add some more debug lines to the code. 1. So that it is clear which code is running and which code doesn't. 2. Also inspect some of the variable so that we don't have to gamble what values are used. If you give me enough of that, then yes I will be able to help you better.
-
local url = guiGetText(edit) triggerServerEvent("musics", resourceRoot, localPlayer, url ) addEvent("musics", true) addEventHandler("musics", resourceRoot, function(player, ...) if isElement(player) then triggerClientEvent("music", resourceRoot, player, ...) -- send to all players end end, false) addEvent("music", true) addEventHandler("music", resourceRoot, function(player, url) if isElement(player) then local x,y,z = getElementPosition(player) local sound = playSound3D(tostring(url), x, y, z, true) setSoundMaxDistance(sound, 100) exports.bone_attach:attachElementToBone(sound, player, 11, 0, 0, 0.4, 180) --[[ ... ]]
-
That was already in the code from the beginning. You are asking the wrong person for that information.
-
https://wiki.multitheftauto.com/wiki/EngineApplyShaderToWorldTexture See syntax for target element. Create a table serverside containing the shader target information and send that over when they join. Shouldn't be too hard after following a table tutorial.
-
I can't detect any issues with the code after a quick look. Are you sure you tested it correctly?
-
See this page for inspiration on how to setup the bindkeys: https://wiki.multitheftauto.com/wiki/OnVehicleWeaponFire The shots can be limited by disable the control: https://wiki.multitheftauto.com/wiki/Control_names vehicle_fire
- 1 reply
-
- 1
-
It should be available with in the element property window.
-
First get the blip, then destroy the vehicle. Line 21, 22 Where is the blip creation part? Also, never trust values, so always add value checks.
-
Move line 14 until 20. To line 6. The reason behind the error is that some of the functions aren't loaded yet before you use them.
-
That is mostlikely the issue.
-
You can freeze them, but that also means that you can't move them after loading the map.
-
I am missing some of the functions. Also there is 0 documentation... Please use the default functions: local DBConnection addEventHandler("onResourceStart", resourceRoot, function () DBConnection = dbConnect ( "mysql", "dbname=DBNAME;host=HOST;charset=utf8", "USERNAME", "PASSWORD" ) if not DBConnection then cancelEvent(true, "Can't connect to the database.") end end) function query(...) local queryHandle = dbQuery(DBConnection, ...) if (not queryHandle) then return nil end local rows = dbPoll(queryHandle, -1) return rows end addCommandHandler("elo", function(plr, cmd) local id = getElementData(plr, "gameaccountid") if id then id = tostring(id) local data = query("SELECT * FROM characters WHERE account='" .. id .. "' AND cked = 0") if data then iprint("data", data) for i=1, #data do local character = data[i] iprint("character", character) local nick = character["charactername"] if nick then outputChatBox(nick) end end else iprint("no data") end end end)
-
No. The event system is a key component in MTA that should be well maintained. This is absolutely killing performance CPU as well as bandwidth: for theKey,players in ipairs(getElementsByType ( "player" )) do -- triggerServerEvent("sendMessage", localPlayer, localPlayer, players, message) -- end If you want to optimise this, then use 1 trigger event with a list of players. But still wasting bandwidth like this, will result in network issues and text delays. So my recommendation: - Do everything serverside. - Use this function to collect the players: https://wiki.multitheftauto.com/wiki/GetElementsWithinRange (Cube, not sphere) - Compare the distance as you were already doing for accuracy results. - add a spam filter - add a limit how many messages a player per second can send. - only display an X amount of messages per Xms, the rest will have to wait in a buffer. So that server lag will be limited to only text lag.
-
I am not sure what kind of software your are using, but it looks old. The fetch function normally would use a loop to fetch new data from the handler. But in your case I do not see an handler at all. query + make the request > Then start fetching as long as there is data with a loop. Are you able to connect manually to your db? https://wiki.multitheftauto.com/wiki/DbConnect Or can you provide some information about the socket/resource you are using?
-
The very reason the gui-Static-Image goes on top, is because you clicked on the bounding box of the image. To prevent clicking, disable the gui-Static-Image: https://wiki.multitheftauto.com/wiki/GuiSetEnabled
-
Oh lol, then you ran it on speedy mode. I wasn't sure if it loaded all collision fast enough so I put it on slowmode and it took ~3 hours to process ?, including the separated db queries as second process. (6k*6k, 2x2 grid) I7 3770k - 3,5GHz
-
How long did it take for you to complete the process?
-
Hmm interesting. Good job! Not so long ago I did the same. Scanning the whole GTA san map 2 units x 2 units and saving all points in to a db. All though my file was a lot bigger, containing not just the x, y, z.
-
You can resave the map root out of: https://wiki.multitheftauto.com/wiki/LoadMapData Or duplicate when loaded with the meta.xml: https://wiki.multitheftauto.com/wiki/GetResourceMapRootElement Good luck!
-
No, element-userdata-values are not elements. They are just references to the real elements and they are not re-use able when converted to a string. Use ID's to make that link. https://wiki.multitheftauto.com/wiki/SetElementID You could also save it as a map and load it as a map. local parent = createElement("vehicleParent") local vehicle = createVehicle(...) setElementParent(vehicle, parent) local file = xmlCreateFile("saved.map", "map") if file then saveMapData ( file, parent) xmlSaveFile ( file ) xmlUnloadFile ( file ) end https://wiki.multitheftauto.com/wiki/SaveMapData
-
Here: https://forum.multitheftauto.com/forum/87-resources/
-
There is 1 thing you can do, and that is to run your editor on a separated server. So that when you write your command, you reconnect to the other server.
-
Not possible with the current editor. Try to find an editor that is capable of that.