GetEntityLastAttacher - Server SIde native

the idea is to provide a way for us developers to counter hackers who attach stuff to other players

for example

RegisterNetEvent("test",function(veh) -- Don't ask me how the event would be sent that is not the point here
    local veh = NetworkGetEntityFromNetworkId(veh)
    if(DoesEntityExist(veh)) then
        local attacher = GetEntityLastAttacher(veh)
        if(DoesPlayerExist(attacher)) then
            DropPlayer(attacher,"Hacking")
        end
    end
end)

sv_filterRequestControl is not useful here since the hackers can simply create their own entities or just walk into a car to get control of it and then attach it
plus its not really an option for me for my server’s own reasons

ty

Hey @AngeloneIL - Hopefully this doesn’t detract from the main point, but at least as of now for the server side, we have GetEntityAttachedTo (source). In theory, you may be able to parse through entities such as players, or vehicles that have recently attached and log the entities and players / owners. From there, you can take action on them.

This is a workaround assuming the logic that you’re asking for doesn’t get implemented, but at least it’s a shred of something.

Realistically, to be able to parse the last entity that attached would be a lot lighter as the server admin wouldn’t need to be responsible for this type of logging, but the fiveM framework would. Still it’d be cleaner code than a large portion of the userbase would create…

thank you for your comment i am already aware of that option i would prefer something more straight forward however

GetEntityAttachedTo uses me for other stuff like cleaning detached objects that are no longer needed like weapons on the back etc… its not really fit for the job here