-
Posts
6,084 -
Joined
-
Last visited
-
Days Won
215
Everything posted by IIYAMA
-
You have to put it at the location where you want to make your trace. If you do not put it inside of another function, it will return "in main chunk", because it is tracing function calls starting from the main chunk. For example: function test1() test2() -- call test2 end function test2() test3() -- call test3 end function test3() test4() -- call test4 end function test4() -- ENDS HERE print(debug.traceback()) end test1() -- STARTS HERE Will return: stack traceback: Main.lua:14: in function 'test4' Main.lua:10: in function 'test3' Main.lua:6: in function 'test2' Main.lua:2: in function 'test1' Main.lua:17: in main chunk [C]: in ? It will show all functions that have been called. And for your current code, it might give you the function(s) where, your onClick got lost.
-
Like this? function createButton(config) local self = setmetatable({}, Button) iprint(debug.traceback()) self.x = config.x self.y = config.y self.width = config.width self.height = config.height self.text = config.text or "Button" self.color = config.color or "blue" self.fade = config.fade ~= false self.onClick = config.onClick or false -- // This always returns false, even if I added onClick function. self.alpha = self.fade and 0 or 255 self.fade_step = 15 self.visible = true self.currentColor = Theme.colors.button[self.color].background table.insert(activeButtons, self) return self end
-
Hmm. Can you show a trackback from your button constructor? iprint(debug.traceback()) Just to get an idea trough how many other functions it's constructed. Not sure what the results are, but it might give you some other places to look at and find where your value gets lost. Make sure to only construct one thing at the time, else it generates too much.
-
One of the common problems is that function values are not clone able. Functions rely on their context and can therefore not being copied to another context. But not sure if that is the issue. For the Button class I am missing some context. In the first file it is used as a metatable. And in the second file it is used as a function. (which might also be a metatable, but I am unable to verify it because it is missing) Is this export importing Button.lua? Other: Watch out for setTimer parameters cloning Export cloning TriggerEvent cloning Original metatable data is modified by another button creation Might need to use raw(get/set) (context based): https://www.lua.org/manual/5.1/manual.html#pdf-rawset https://www.lua.org/manual/5.1/manual.html#pdf-rawget
-
It is on the top of the code, just running once at the beginning. Could you explain why you put it there? Just so that I can understand the context of that variable placement, because normally you wouldn't put it there unless there is a specific reason.
- 1 reply
-
- math.random
- job
-
(and 2 more)
Tagged with:
-
It is indeed a kind of attack. It means that the player is able execute clientside-code on demand. The attacker is triggering 'known generic events' which might be handled by the server. The ones that are unknown are in your logs, the ones that are known and trigger able are not. But that does not mean that the ones that did trigger didn't cause unwanted results. You might want to consider to restart the resources, just to make sure there is no memory leak. The event which AngelAlpha mentioned can indeed help with detecting that kind of attacks. As an extend you can also add a honeypot, which in this case are 'unkown' events for your server but know for other servers. When a player uses this kind of attack again, you can ban them automatic. You might want take a closer look at your logs for candidates (for example money related). There is also this event: https://wiki.multitheftauto.com/wiki/OnPlayerTriggerEventThreshold But be careful with automating things, always test these kind of stuff or you might accidentally nuke your own player base.
-
You can either download the newest here: https://github.com/multitheftauto/mtasa-resources Or go back to a specific commit: https://github.com/multitheftauto/mtasa-resources/commits/master Download button can be found under 'Code':
-
It will probably be visible when the camera is fade out. So yes you need to add some more exceptions for unexpected situations. This condition might catch some of the problems: if getCameraTarget () ~= localPlayer then return end
-
I don't think there is a way to force it. If it did, then it should be defined here: https://wiki.multitheftauto.com/wiki/HUD_Components#Properties https://wiki.multitheftauto.com/wiki/SetPlayerHudComponentProperty But as alternative you can draw a bar under it with: https://wiki.multitheftauto.com/wiki/DxDrawRectangle https://wiki.multitheftauto.com/wiki/DxSetAspectRatioAdjustmentEnabled https://wiki.multitheftauto.com/wiki/OnClientHUDRender
-
Maybe move the checkpoint very high in the air (and replace it with a dummy). When the rocks are cleared, move it back.
-
It is a permission issue. https://wiki.multitheftauto.com/wiki/Server_Commands#aclrequest First verify if the meta.xml has any acl request listed in it's meta.xml /aclrequest list <resourceName> all And if loadstring is listed, grand permission. /aclrequest allow <resourceName> all If not listed, add it to the meta.xml of the resource: <aclrequest> <right name="function.loadstring" access="true" /> </aclrequest> See example: https://wiki.multitheftauto.com/wiki/Meta.xml Run: /refreshall And try the aclrequest commands again.
-
Are you sure your API is capable of accepting JSON? fetchRemote(url, { method = "POST", formFields = { adminName = "", action = "", mapName = "" }, }, function(responseData, responseInfo) If JSON is expected, see also this comment on the wiki page: postData = string.sub(postData, 2, -2)
-
Haha, I also updated it just for you XD
-
There is also this useful function: https://wiki.multitheftauto.com/wiki/GetScreenStartPositionFromBox
-
Are you using this function? https://wiki.multitheftauto.com/wiki/CreateProjectile Attach a dummy vehicle to the object and set the vehicle as the creator of the projectile. Because else your camera is used for the direction.
-
See: https://wiki.multitheftauto.com/wiki/FindRotation3D
-
By showing the cursor: https://wiki.multitheftauto.com/wiki/ShowCursor Though setCameraMatrix might also be possible, but you will have to reset the camera.
-
As Justn and me mentioned: Move this line to the top of your code: Like this: local sx,sy = guiGetScreenSize() local px,py = 1600,900 local x,y = (sx/px), (sy/py) local Inventory = dxCreateTexture("Inventory.png") -- just put it here and not inside of HUDDrawing. function HUDDrawing() --[[ ... ]]
-
The following functions shouldn't cause crashes: https://wiki.multitheftauto.com/wiki/DxDrawRectangle https://wiki.multitheftauto.com/wiki/DxDrawText But you most likely did crash because of a memory leak. To find the reason I will need to look at your code for that. Just a thing that can lead up to a crash: By putting dxCreateFont/dxCreateTexture/dxCreateScreenSource(everything with Create in it's name) inside of an onClientRender triggered function
-
setGlitchEnabled("quickreload", true) https://wiki.multitheftauto.com/wiki/SetGlitchEnabled You could the enable the quickreload glitch. For testing: /start runcode /srun setGlitchEnabled("quickreload", true)
-
I wouldn't run that function either in combination with onClientRender. Since you are fetching the file from another resource, you could increase or decrease the download priority for either resource. https://wiki.multitheftauto.com/wiki/Meta.xml Or just wait a little bit longer before start rendering. (I also recommend to convert the image into a texture before rendering)
-
Can't you better change the password? https://wiki.multitheftauto.com/wiki/Server_Commands#chgpass chgpass <accountname> <password> (using the console) Else: https://wiki.multitheftauto.com/wiki/Server_Commands#delaccount delaccount <accountname> (using the console)
-
You could check out these files/resources: https://github.com/gta191977649/MTA-VCS/tree/main/mods/deathmatch/resources/[vcs] Download able at root: https://github.com/gta191977649/MTA-VCS/tree/main Though you have to verify yourself if this is a good source or not. I only Googled it for you.
-
The Console has full access, so it might be possible that you currently have no access to begin with. Steps to add the initial admin account (later on you can add more admins ingame using the User Interface): Stop the server Open the ACL file: MTA San Andreas 1.6\server\mods\deathmatch\acl.xml Make a back up of this ACL file Scroll to (in the original one): <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="resource.webadmin"></object> <object name="resource.acpanel"></object> </group> Add an account looking like this: <object name="user.example"></object> Replace example with your username even if the account does not exist yet. (keep it simple) And add it like this: <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="resource.webadmin"></object> <object name="resource.acpanel"></object> <object name="user.example"></object> </group> Save the file Start the server again (if you broke the syntax of the file, the server will not start, that is why step 3 so you can start over) Go ingame Add the account if not exist: /register <example username> <new password> /login <example username> <current password>