mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Server doesn't verify if attached vehicles can be attached

Open CrosRoad95 opened this issue 1 year ago • 3 comments

Describe the bug

Server doesn't verify if attached vehicles can be attached. So you can attach turismo to bike and cheaters are using it. image

https://github.com/multitheftauto/mtasa-blue/blob/master/Server/mods/deathmatch/logic/packets/CVehiclePuresyncPacket.cpp#L183-L279

Steps to reproduce

  1. Be cheater
  2. Cheat

Version

Any, i see on newest main branch there is no even mention of model id.

Additional context

No response

Relevant log output

No response

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not security related.

CrosRoad95 avatar Sep 13 '24 18:09 CrosRoad95

What is the difference between attaching a turismo to a bike and a turismo to a tow truck? Therefore, I believe that attaching/detaching trailers should not be done in the form of a synchronization packet but should be based on actual game behavior via hooks, something like #3660

FileEX avatar Sep 13 '24 20:09 FileEX

What is the difference between attaching a turismo to a bike and a turismo to a tow truck? Therefore, I believe that attaching/detaching trailers should not be done in the form of a synchronization packet but should be based on actual game behavior via hooks, something like #3660

It is not bad idea, also replying to what Tracer said me on dm, indeed, you can replace bike with tow vehicle thats why server should have dynamic list of models that can tow other vehicles and list of trailers configurable from lua "setModelTowable(model, true/false)", "setModelTrailer(model, true/false)",

Also, you should take an account that trailer id 435 can be towed by 403 vehicle and not 531. Example functions i mention above should have some "group" argument, or do it using flags for more customization.

AND, current logic doesn't check distance, it should be also taken an account, function to configure it should be added "setMaxTowDistance( float )"

All fuctions serverside

CrosRoad95 avatar Sep 14 '24 04:09 CrosRoad95

Attaching (like glue script) is not the same as towing (with towtruck or truck-trailer). The ideas u just pointed for setModelTowable etc are nice, but this is not related to the issue's post

Fernando-A-Rocha avatar Sep 17 '24 15:09 Fernando-A-Rocha