-
Posts
6,085 -
Joined
-
Last visited
-
Days Won
215
IIYAMA last won the day on May 10
IIYAMA had the most liked content!
About IIYAMA
- Currently Viewing Forums Index
- Birthday 01/01/2016
Member Title
- Global Moderator
Details
-
Gang
[HB]
-
Location
Netherlands
-
Occupation
I have never been to the streets of SA... so who knows?
-
Interests
Design, scripting, UX/UI
Recent Profile Visitors
70,431 profile views
IIYAMA's Achievements

Gangsta (45/54)
1.5k
Reputation
-
Excellent71 started following IIYAMA
-
IIYAMA started following fetchRemote isn't POSTING. , cheaters canceling onClientPlayerDamage , [HELP] Function transfer from within constructor and 6 others
-
anti-cheat cheaters canceling onClientPlayerDamage
IIYAMA replied to MineX server's topic in Scripting
You might be able to detect it using: https://wiki.multitheftauto.com/wiki/WasEventCancelled Though I do not know if this functions works correctly for native events. Something you have to test yourself. Make sure to set the addEventHandler to low priority. -
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