I present to you a script with which you will be able to unhook a trailer from a truck. I made two versions that are not very different. In the "singleplayer" folder, the script is intended for a single player game, and "samp-crmp" is for multiplayer!
Activation for SAMP and CRMP: Shift+C (By default, you can change it!)