if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); else AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));