-
Posts
6,062 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
You are now loading the fish script 2x. 1 version serverside and 1 version clientside. That is not going to work. You need to separate those sides. So: 1 script/file serverside, with serverside code. (Running in the server application) 1 script/file clientside, with clientside code. (Running on each player his computer in the MTA game itself)
-
Show me your meta.xml
-
Yes, your script is passing over arguments that are used within the rgbOpenPicker as parameters. In: rgbOpenPicker("left", "up") Out: function rgbClosePicker(button, state) --[[ ... ]] iprint(button) -- outputs "left" iprint(state) -- outputs "up" --[[ ... ]] For you the definition of an effect is apparently: Everything works fine! Which is for me not really useful, if it is positive, it only means that I do not have to help you any more. The effects that are relevant for me are: Are there errors/warnings from this script? Is this, this, this and this code executed? Are the values of a variable correct? And how would I get that relevant information? That is where you come in! So please help me too. Debug the code for me!
-
A lot of clean up has to be done. Oke the first thing I want to mention is this: <script src="testy-c.Lua" type="client"/> <script src="rgbpicker/gui.Lua" type="client"/> The test script is loaded first, therefore it is executed first. Which means that you are calling the function rgbOpenPicker, which has not been created yet. So you might want to switch that order or add the onClientResourceStart event, which will wait until all scripts have been loaded. Next: exports[getResourceName(getThisResource())]:rgbOpenPicker(true) or rgbOpenPicker() Please follow my instructions. This experiment was not included, please do reset that back before continuing and iterating. Next: rgbOpenPicker("left", "up") If you are using arguments, then make sure to fill them in. Last thing, add debug lines, just for me please?
-
Show me your meta.xml (+ let me know which file contains which code)
-
Export is used only when you have 2 (or more) separated resources. So for example: - admin (resource 1) - editor (resource 2) - freeroam (resource 3) If you have only 2 files within 1 resource, then yes that is the way to go from my previous post
-
Just 2 files If it is 1 or 2 doesn't really matter when using the event onClientResourceStart.
-
@VaporZ function rgbOpenPicker() --Do some GUI stuff end addEventHandler("onClientResourceStart", resourceRoot, function() -- We are loaded and now we open the color picker rgbOpenPicker() end)
-
No, you are calling the function before it is created. Move the event stuff to clientside 2, so that you can delay the call and not the creation time.
-
Just call it, you defined the variable/function as a global, therefore it is not bound to the file scope. rgbOpenPicker() After the onClientResource event has been triggered, you know for sure that all global variables are available everywhere. (All files have been loaded)
-
You are exporting within the same resource. The resourceName has to be the name of the resource with the export function.
-
2 scripts, within the same resource You can either use globals: some_button_data = 5 addEventHandler("onClientGUIClick", BUTTON_ELEMENT, function() iprint(some_button_data) end) Or return values: local some_button_data = 5 function getData () return some_button_data end addEventHandler("onClientGUIClick", BUTTON_ELEMENT, function() local some_button_data = getData() end) And if you are dealing with multiple resources, you can use exports: Resource 1 <!-- meta.xml --> <export function="getData" type="client"/> local some_button_data = 5 function getData () return some_button_data end Resource 2 addEventHandler("onClientGUIClick", BUTTON_ELEMENT, function() local some_button_data = exports["resourceName"]:getData () end)
-
The problem has nothing to do with CSS, but with the configuration of the browser. See the 6e argument 'isTransparent', of the guiCreateBrowser function: https://wiki.multitheftauto.com/wiki/GuiCreateBrowser
-
setCameraTarget(localPlayer) -- client setCameraTarget(player) -- server
- 1 reply
-
- 1
-
Add debug lines! Are you reading none of my comments at all for real? function dxDrawTextOnElem(element, text, height, distance, r, g, b, alpha, size, font) allElems = allElems + 1 triggerClientEvent("dxDraw", resourceRoot, element, text, height or 0, distance or 20, r or 255, g or 0, b or 0, alpha or 255, size or 1, font or "arial", allElems) iprint("did trigger from serverside") end addEventHandler("dxDraw", resourceRoot, function(element, text, height, distance, r, g, b, alpha, size, font, k) iprint("It did trigger! With those parameters:", element, text, height, distance, r, g, b, alpha, size, font, k) After checking that and it still doesn't trigger, that most likely means that you triggered it before the client has loaded his code.
-
How are you even creating that vehicle when the event "onClientMarketHit" only triggers clientside? If you used that code serverside, there wouldn't be any vehicle in the first place.
-
RenderTargets can be used to create boxes, which can act as an mask so that only a little part can be visible and the rest gets cut-off. If you are going to work with renderTargets try to prevent doing re-drawing inside of the renderTarget. Only re-draw when you actually made changes. Sometimes using multiple renderTargets can also reduce re-drawing times. (For example if you have drawn 20x text which is already drawn inside of another renderTarget) Capturing the pixels inside of the renderTarget is a very CPU intensive process. For the rest there is not much you have to worry about.
-
It looks like your serverside script is running clientside. So yes those are probably related.
-
Because you created them clientside. They are not synchronised with serverside, therefore it would cause desync if you could drive them. To solve that, create the vehicle serverside. You probably hit the marker while driving a vehicle? The event is triggered for the vehicle as well as the player. To solve that, check if the hit element is the localPlayer. if botdeniz == localPlayer then end
-
I will lock your topic if you keep making useless bumps. If nobody answers your question or the answers are not satisfying, then you didn't ask the right question as simple as that.
-
You are inserting the JSON string inside of a table, which you convert back to a JSON string. Which ends up in ??? local s = fromJSON(dd) table.insert(dd, s) setAccoountData(getPlayerAccount(v),"SkinsT", toJSON(s))
-
And which part of the code doesn't work? The saving part? The loading part? The sending part? The grid display part? You know better than me that you have to debug each individual part in order to figure out were the issue is located.
-
I am not sure what the problem is. But you can assign data to a grid item. https://wiki.multitheftauto.com/wiki/GuiGridListSetItemData Including tables.