MTA Anti-Cheat Team Popular Post Dutchman101 Posted August 26, 2016 MTA Anti-Cheat Team Popular Post Share Posted August 26, 2016 Imagine you have a gamemode and you forbid a certain vehicle, but players still end up driving them and they are infact spawned. It can be a resource vulnerability, multiple scripts on your server can spawn vehicles, or a hack like LUA injector that enables them to be spawned. You want to find out the origin of these vehicles in order to debug the responsible resource (knowing which script contains a possible vulnerability or bug) and need a debug script to find out the culprit. Ofcourse you can just script the violating vehicles to blow up or destroy as soon spawned, but I can understand you also want to know what's actually happening. I had this scenario myself, fixed and found it out myself. It's a waste to just put this script in the bin, so I share it with others that may find themselves with the same or a similar problem. It wasn't easy either to find a proper way to let it work. CODE: local triggeredByModels = { [432]=true } function detectVehicleCreation() if getElementType(source) == "vehicle" and triggeredByModels[getElementModel(source)] then outputServerLog ("** ILLEGAL VEHICLE DETECTED ** "..getVehicleName(source).." was found at "..toJSON({getElementPosition(source)}).. " dim: "..getElementDimension(source).. " & int: "..getElementInterior(source)) local x,y,z = getElementPosition(source) local sphere = createColSphere(x,y,z,40) setElementInterior(sphere, getElementInterior(source)) setElementDimension(sphere, getElementDimension(source)) attachElements(sphere, source) local players = {} local pc = getElementsWithinColShape(sphere, "player") for _,p in pairs (pc) do if p then table.insert (players, getPlayerName(p)) end end if players and #players ~= 0 then outputServerLog ("** Nearby players: "..toJSON(players)) end outputServerLog ("** Responsible resource: "..tostring(getElementID(getElementParent(getElementParent(source))))) destroyElement(sphere) end end addEventHandler ("onElementStartSync", root, detectVehicleCreation) Serverside script. By default (as code above) it's defined to trigger for vehicle ID 432 (rhino) you must change this ofcourse. So what this does, is log the responsible resource if possible that made the vehicle get spawned, and logs the players in direct vinicity of the vehicle as soon it starts to exist, most of the times the player closest to the vehicle is the creator or spawner so you can identify them, punish player/ask them for details about the leak if you're sure that could be them. If it's a LUA injector hack it's likely no usable resource origin (spawner) will be output, you can determine a player using hacks possibly this way. 5 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now