-
Posts
1,131 -
Joined
-
Last visited
-
Days Won
2
Everything posted by MIKI785
-
See this: https://wiki.multitheftauto.com/wiki/Element_tree The root element contains every single element present on the server (or each client if used clientside). Resource root element contains every element under that resource, so if the resource creates an object using createObject, it will be contained within the resource root but also within the root element (as that contains all the resources). It's like XML.
-
As far as I know, the (default) order in which the servers are shown in the server list is based on the server's age. Older servers are above newer ones. If the server is offline for some time (don't know how long, a few days) or the IP changes then its position gets reset. That's my understanding at least.
-
I have used this before myself and it did work wihout any problems. What values are you putting in?
-
dxDrawMaterialLine3D has further 4 arguments that you're not using. First one is postGUI (irrelavant) and the other 3 are X, Y and Z coordinates of where the drawn picture will be "facing". Use those to rotate it.
-
Or you could simply use guiCreateStaticImage, draw the text on it using guiCreateLabel with the image as parent. Then simply attach onClientGUIClick and there is no difference.
-
What you can do is to make a module, see here: https://wiki.multitheftauto.com/wiki/Modules. But that's only server side.
-
If you want to control whether the rockets actually seek the target or not you have to implement this yourself using createProjectile.
-
You can't remove that. It's an anonymous function, so you don't have the pointer to it (its name). You can't reference anonymous functions, therefore you can't reference it in removeEventHandler.
-
Try starting the server manually from MTA/server/MTA server.exe.
-
engine functions are 'global'. You cannot replace a model for a single element. You may only replace the texture using shaders.
-
Yes? I've told you what's wrong. Also, I can't see getElementData with the same data name anywhere.
-
You're not setting any value.
-
The wiki says that it may return nil if there aren't any more rows to return. Are you sure that the result set isn't empty?
-
You're saying that youre not able to rename a file and you get an error saying 'Access denied', isnt that an ACL issue? Does the resource have access to it?
-
You have to give the resource calling fileRename access to ModifyOtherObjects or something like that, look for it in your ACL.xml and you'll find it.
-
In short, yes. But it depends on the approach. If you're using GUI Memo then no, that won't work. If you're using dx then yes, you can make that work (but that would be unnecessarily difficult). I personally think that the best approach here would be to use CEF. It would be very easy to make that happen since there are o lot of open source script editors written in JavaScript for the web, just google it and I'm sure you'll find loads.
-
I just noticed that he uses an element to index the table, that can't be saved into a file. You'd have to use a different way of knowing which vehicle you're talking about. setElementID and getElementByID could be the answer,
-
I don't see you saving it anywhere though. addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), function() for k, vehicle in pairs(getElementsByType("vehicle")) do if indicatorInfo[vehicle] then local data = toJSON({indicatorInfo[vehicle]["side"] or nil}) end end end ) You store the data in a local data and that's it. So the data is then lost, it never gets saved anywhere. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() bindKey(blinkerLeft, "down", toggleIndicator) bindKey(blinkerRight, "down", toggleIndicator) bindKey(blinkerBoth, "down", toggleIndicator) for k, vehicle in pairs(getElementsByType("vehicle")) do indicatorInfo[vehicle] = indicatorInfo[vehicle] or {} indicatorInfo[vehicle]["side"] = fromJSON(data) end end ) Here the data is undefined/nil. You never give it a value. You should save the data somewhere, database would be the best but if that's too complex then try simply saving it into a file and then read that file when the resource starts.
-
No. This section is not intended for code requests. You're supposed to post a snippet, tell us what's wrong, any debug info and we will try to help you. I'm saying that you are triggering a server side event 'gundv:respawnVehicle' but that event is never handled on the server side (at least not in the snippet you provided).
-
gundv:respawnVehicle -> don't see that being handled anywhere.
-
Did you try reinstalling GTA? Appears to be modded, don't know if that's the cause though.
-
You still don't get it.. root element never changes. Root is root.. all other elements are underneath this element in the element tree (see here: https://wiki.multitheftauto.com/wiki/Element_tree), hence the name root. What happens here is that onClientMarkerHit gets triggered on all clients, doesn't matter which player hit the marker. If you check if the hitelement is the localPlayer then the onClientRender event will be handled only for the player that hit the marker.
-
Because onClientMarkerHit is triggered for all players and you're not checking if it's the localPlayer.
-
No it doesn't. It's on the client side, meaning that root is the client's root element.